Tips to Test, Deploy App Services in Same Azure Platform/Environment After Production
Undoubtedly Azure app services, power packed with amazing features, is extremely useful to developers. Because, it not only offers powerful web, API and mobile, and function apps but also enables you to get up and running in minutes. Besides it provides a full spectrum of fascinating features like scalability, easy authentication, offline sync (for mobile apps), hybrid connections etc.
But one of the underrated Azure app service features that most of you’re not aware of/hasn’t utilized is deployment slots.
Imagine, have you ever had a chance to test your app in the same platform/environment as your production? Sounds great, right? Well, Azure slots do that for you. In brief, you can test it in your production environment without any hassle.
Here is the list of common deployment issues.
- Getting started with testing new version of app
For instance, let’s assume you’ve a web app running and live in the app service with a URL Produtionapp.azurewebsites.net and you want to update that. So, post updating, you have to deploy the new version to the production URL.
But performing this without relevant testing would lead to failure. So, creating a new app service before deploying the new web app, porting the configurations and testing it over there is recommended for success.
- Considering deployment/rollback when facing issues
Now, you have the new version of the app tested. Next, would be the time to deploy the app to production URL. But, it requires a downtime for deployment, testing. Besides, the type of architecture of your app may force you to pay a cold start penalty as well. This is an issue. How to resolve the issue? Deploy or rollback, what could be your next move?
You know deploying with an issue would be detrimental. So, next thing that strikes your mind would be how to rollback when there is an issue, and you are not left with any choice!
- Utilizing deployment slots to the RESCUE
This is where Azure deployment slots come in handy. Visualize what if you’ve different boxes inside your app service with every slot having its own publishing profile, configurations and app settings. This would make your job simpler right!
So, the default slot would be your production slot, even though you don’t create one! By now, you can create new slots and deploy any new versions of apps without stressing out on issues.
Post creating new slots, next step would be publishing profile and deploying new version of your app. By now your app would be production-ready and available in same environment, but with different URL, configuration and app settings. Find the image below to realize how your apps would be deployed.
To move your new version of your app to the production URL, you can use the swap option. Looks simple, right? Yes, this is why Azure deployment is used by many as the slot simplifies your headaches and ensures seamless app service porting to production URL.
By simply swapping your app, the source slot will be moved to the destination slot in no time. The configuration and settings are simultaneously moved as well. The image below explains this.
Now, you’ve deployed your app to production with zero downtime. As Azure warms the slots before swapping, you can completely rule out cold start issues. If at all, you need a rollback, just swap it again and you’re done!
Here are few points you should consider when planning for deployment slots.
- Deployment slots are designed to support only Standard or Premium App Service plan mode
- When your app has multiple slots, mode change isn’t allowed
- Scalability is an issue for non-production slots
- Each App Service plan mode supports different deployment slots
- Each slot shares the same pool of resources similar to live/production slot; this makes load test impossible
- Deployment slot URLs are different from original App Service, as the URL is based on deployment slot name provided
- While scaling a deployment slot, all other slots of your App Service are automatically scaled; because all slots share the same App Service Plan
The Final Word
Azure offers users pay-as you go payment option that makes it a viable option for many. It fits the IT budgets for most IT organizations and also reduces the infrastructural cost that shoots the budget up. It is very convenient to maintain the technical structure when it comes to Azure and IT management is a breeze. However, it goes without saying that the Azure app deployment is intrinsic process and requires expertise to function effectively.
Don’t know how to get started with Azure app service deployment? We are certified Microsoft Azure partner and we can help.