Deployment Appears to Erase AppService Zip Deployment #13172
-
I have a Bicep template that I have been authoring over the past few weeks for a system of AppServices that I have. I use a PowerShell script to deploy the Bicep template and create the infrastructure. I then have Azure DevOps create a release and deploy the zip files to the AppServices created from the above. My issue (that I just encountered) is that if I redeploy the Bicep template, it appears to erase the zip file of the Azure DevOps deployment, clearing the Deployment Center deployment. That is, it appears each Bicep deployment clears all Deployment Center deployments. 💥 Is there a way to prevent this from happening? When I re-deploy a Bicep template I simply want to update the properties/values of the environment, not destroy anything. Thank you for any assistance you can provide. |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 4 replies
-
Is it expected to clear Deployment Center deployments on each Bicep deployment? 🤔 This seems a bit disruptive... |
Beta Was this translation helpful? Give feedback.
-
Can you share your template? |
Beta Was this translation helpful? Give feedback.
-
As this seems like a bug, I have created an issue here to track: https://github.com/Azure/bicep/issues/13282 |
Beta Was this translation helpful? Give feedback.
-
I don't use the Deployment Center functionality in my web apps, so I don't have any solid answers. However, it seems likely that the resource provider is removing things based on missing settings in the Bicep template. I can think of two potential solutions: including the full configuration or marking it as an existing resource. Full configuration would look something like this: resource subject 'Microsoft.Web/sites@2023-01-01' = {
name: qualified
...
resource deploymentCenter 'config' = {
name: 'metadata'
properties: {
CURRENT_STACK: 'dotnet'
RepoUrl: 'https://org@dev.azure.com/org/project/_git/repo'
subscription: subscription().subscriptionId
VsoTfsImpersonate: 'something@live.com'
CloneUri: 'https://org@dev.azure.com/org/project/_git/repo'
branch: 'main'
}
}
} Reference the existing settings: resource subject 'Microsoft.Web/sites@2023-01-01' = {
name: qualified
...
resource deploymentCenter 'config' existing = {
name: 'metadata'
}
} |
Beta Was this translation helpful? Give feedback.
-
Woohoo! I figured it out! Wow it was a tricky one. The problem was that the I feel like a knucklehead now that I understand this but I am glad this is solved. Onto the next fire. |
Beta Was this translation helpful? Give feedback.
-
Sorry for the late response. but glad you were able to sort this! |
Beta Was this translation helpful? Give feedback.
Woohoo! I figured it out! Wow it was a tricky one. The problem was that the
WEBSITE_RUN_FROM_PACKAGE
environmental variable was not set! I was thinking that DevOps would be responsible for setting this, and it does. However, when the Bicep deployment executes and this property is not part of the configured settings (and I do not merge them with existing) it gets erased.I feel like a knucklehead now that I understand this but I am glad this is solved. Onto the next fire.