0

I have an Azure Web App which is currently configured in Deployment Center to auto-deploy when code is pushed to a particular git repo. I don't want that to happen because that auto-deploy is going directly to prod and making it inaccessible to users. I want to disable that behavior in Deployment Center and control that process completely through slots associated with the web app.

My understanding is that I should be able to manage that process within the context of slots. Then I should be able to simply swap slots when I want to deploy to prod with zero impact to prod.

  1. Can you please confirm if my understanding of this Azure capability of managing deployments through slots is correct?
  2. Can you please describe how I would accomplish this? I can't seem to figure out how to disable the default auto-deploy process associated with the primary Deploy Center for the web app
James Z
  • 12,209
  • 10
  • 24
  • 44
user7864139
  • 185
  • 2
  • 10
  • Refer the point in this MS Document- https://learn.microsoft.com/en-us/azure/app-service/deploy-continuous-deployment?tabs=github#what-happens-to-my-app-during-deployment You can create one staging slot and enable auto-swap to deploy your code in staging slot test it and then switch to Production slot. Also, Make sure you specify the slot in your source code as given in the above document here- - uses: azure/webapps-deploy@v2 with: app-name: '' slot-name: 'production' or any other method to specify deployment in specific slot. – SiddheshDesai May 13 '23 at 07:14
  • To disable Auto-deploy process just disconnect your source continous deployment by following this Document:- https://learn.microsoft.com/en-us/azure/app-service/deploy-continuous-deployment?tabs=github#disable-continuous-deployment – SiddheshDesai May 13 '23 at 07:14
  • Another workaround is to follow the answer here by kintela and user2528534 -https://stackoverflow.com/questions/58236029/how-to-publish-to-a-development-slot-in-azure-from-vs-code you can add that azure cli command in your source code or edit your source code or deployment script to deploy in spcific slot – SiddheshDesai May 13 '23 at 07:16

1 Answers1

0
  1. Yes! Using multiple slots allows seamlessly moving between different code versions and settings. You can also use the testing in production feature to move a percentage of the traffic for the site to a slot before promoting it.

  2. The Azure Portal Deployment Center will allow for the existing binding to be disabled. The Azure Docs have some instructions if this proves tricky. I'd suggest looking at IaC (such as Bicep) for maintaining your App Service Configuration. In this link you can see that i've created 2 slots, 1 is bound to a staging branch and the other the main branch. This way I can maintain source integration, whilst properly making the most of slots. https://github.com/Gordonby/AzureBicepServerlessAppStack/blob/509cb1b27882965d26e618d99e3db722610ee894/bicep/foundation/functionapp.bicep#L127

GordonBy
  • 3,099
  • 6
  • 31
  • 53