Reputation: 5230
I keep getting this error on two of my four Azure webapps when trying to run my Powershell script to swap my preprod and prod slots.
The command Start-AzureWebsite -Name $WebSiteName -Slot $SourceSlotName
results in the following error:
Conflict: Cannot modify this site because another operation is in progress. Details: Id: b98d4832-5f6b-4bad-9c4e-470a2d0d100c, OperationName:
SwapSiteSlots, CreatedTime: 2/1/2016 9:30:54 PM, WebSystemName: websites, SubscriptionName: bd3570da-d430-485a-a83c-d4ef448b865e, WebspaceName: *******EastUSwebspace,
SiteName: *******, SlotName: preprod, ServerFarmName:
At C:\dev\...\scripts\Swap-AzureWebApp.ps1:18 char:1
+ Start-AzureWebsite -Name $WebSiteName -Slot $SourceSlotName
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Start-AzureWebsite], CloudException
+ FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.Websites.StartAzureWebsiteCommand
No operation is in progress, but I did Git push to my preprod slot some 30 minutes ago...
It looks likes this question, but it is from Powershell, not visual studio, and I'm trying to start a preprod slot, then swap it.
Upvotes: 7
Views: 11338
Reputation: 1
Using Bicep I was deploying multiple hostname bindings with the array syntax.
Adding @batchSize(1)
solved the issue.
@batchSize(1)
resource backendDomainBinding 'Microsoft.Web/sites/hostNameBindings@2022-03-01' = [
...
]
Upvotes: 0
Reputation: 1040
For Terraform: add depends on
source "azapi_update_resource" "elastic_web_app_scale" {
type = "Microsoft.Web/sites@2022-09-01"
name = azurerm_windows_web_app.resourceApp.name
parent_id = azurerm_resource_group.resource.id
body = jsonencode({
properties = {
siteConfig = {
minimumElasticInstanceCount = 1 # Always ready instances
elasticWebAppScaleLimit = 10 # Maximum scale limit
}
}
})
depends_on = [azurerm_service_plan.resourceApp]
}
Upvotes: 0
Reputation: 1294
I got this error when deploying an ARM template with 2 hostNameBindings resources to the same site. Added a dependency to one like below, and resolved.
"dependsOn": [
"[resourceId('Microsoft.Web/sites', variables('sites_name'))]",
"[resourceId('Microsoft.Web/sites/hostNameBindings', variables('sites_name'), variables('defaultHostNameBinding'))]"
],
Upvotes: 2
Reputation: 486
I used Pulumi Native to create a webapp resource. I got this error and I waited 4 days according to dstj's answer. It didn't help. I found was is wrong in another way.
Kind = "FunctionApp"
. At least I got some info that I've got something wrong with my code and the problem is not related with Azure service.Upvotes: 2
Reputation: 7468
Only one of these operations will succeed, and others will show the same error.
If you don't see the "Complete Swap" button, you'll just have to wait, think up to one hour.
Once succeeded, wait a few minutes before attempting to deploy/start to app service again.
Upvotes: 1
Reputation: 2823
I also faced the same issue when try to swap the app from staging to production in CD pipeline. As a solution deleted the staging slot and re deployed.
Then it worked.
Upvotes: 1
Reputation: 5230
It resolved itself, sigh. :/
Both of my Webapps that had errors with my scripts now swap without any error (using the same script).
I waited for about 1h...
Upvotes: 5