-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
azurem_windows_app_slot service_plan_id is reset when it has not changed #21024
Comments
Thanks @daveneeley for raising this issue. Can I confirm with you about the exact behavior? The service plan id that's specified in the TF config is not the same to the existing one that's associated to this app service slot and the specified one is not being respected by provider? |
The service plan id was unchanged. It was the same as when it was created. |
Perhaps that means the service plan id was just not saved to the slot object at all. |
Thanks for the clarification, if this is the case, then you will get the diff in every plan? Let me try reproducing from my side. |
I have the same issue with See failure:
|
@daveneeley A quick follow-up on my comment above. If your slot is using the same |
Yes! I eventually arrived at this conclusion. |
In my case, I'm trying to change the service plan (cleaning terraform debt from azurerm_app_service_plan to azurerm_service_plan), and get the same error. module.common.azurerm_windows_web_app_slot.externalprovidersstagingslot: Modifying... [id=xxx/providers/Microsoft.Web/sites/yyy/slots/staging] I'm using azurerm 3.62.1 (latest as of today) |
But when you change service_plan_id of web app, web app slot dos not change service_plan_id |
Hello Everyone. I agree with @jbhuguenin. It is ok when you are going to deploy from zero the WebApp and slots for it. But if you want to manage existing environment and have a case to change App Service Plan to another one then the WebApp will be moved to new App Service Plan but slot stays on the old one. It will be best to fix it because it will help moving apps with slots to another service plan. |
@PatrykIti May I know how did you swapped the service plan for app service? When I tried to change the service plan for linux web app in azure portal, only the web app will be changed to another service plan but not the app slot. This behavior matches terraform's behaviour, so can you let me know how did you changed the service plan and have you tried to use the api/ azure portal directly? |
I think the issue is the |
Hello @xiaxyi, Yes, you are right. It is only moving web app to the other app service plan but not the slots. If you add 'service_plan_id' parameter to resource block for the slots it will trigger the error about "parsing Azure ID: parse "": empty url". So it seems that terraform cannot handle this functionality for slots somehow. How I swapped the 'service_plan_id' for web_app? I have a module and the 'service_plan_id' is as input for the web app module so If I add another 'app service plan' to my configuration and change reference between modules to another service plan then terraform will move my app to other service plan :) but as I mentioned it is only working properly for the app itself. You can move slots to other app service plan via powershell. Also you may encounter some restriction if you want to move Apps between app service plans with different App Service Environments.
|
Similar or a duplicate of #22763? I can confirm that the Using |
EDIT: added versions info @xiaxyi
Very first terraform: 1.5.6 |
By not providing |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Is there an existing issue for this?
Community Note
Terraform Version
1.4.2
AzureRM Provider Version
3.41.0
Affected Resource(s)/Data Source(s)
azurem_windows_app_slot
Terraform Configuration Files
Debug Output/Panic Output
From second apply:
Expected Behaviour
If
service_plan_id
is specified and has not changed, it should not be marked as new.Actual Behaviour
On the second apply, the error
Error: parsing Azure ID: parse "": empty url
is returned. The execution plan states thatservice_plan_id
will be added (as if it was not set before).The error message is not helpful, nor is the debug output. Neither says
service_plan_id
is empty, only the plan suggests that.Steps to Reproduce
parsing Azure ID: parse "": empty url
Important Factoids
No response
References
#19459 / v 3.41.0 introduces
windows_app_service_slot.service_plan_id
.In v3.40.0,
service_plan_id
cannot be specified on a web app slot; in v3.41.0 it is optional but allowed. If it's present, it is not checked against the previous value.The text was updated successfully, but these errors were encountered: