This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can trysigning in orchanging directories.
Access to this page requires authorization. You can trychanging directories.
ThePython webazd
templates allow you to quickly create a new web application and deploy it to Azure. Theazd
templates were designed to use low-cost Azure service options. Undoubtedly, you'll want to adjust the service levels (or skus) for each of the services defined in the template for your scenario.
In this Quickstart, you'll update the appropriate bicep template files to scale up existing services and add new services to your deployment. Then, you'll run theazd provision
command and view the change you made to the Azure deployment.
An Azure subscription -Create one for free
You must have the following installed on your local computer:
To begin, you need a workingazd
deployment. Once you have that in place, you're able to modify the Bicep files generated by theazd
template.
Follow steps 1 through 7 in theQuickstart article. In step 2, use theazure-django-postgres-flexible-appservice
template. For your convenience, here's the entire sequence of commands to issue from the command line:
mkdir azdtestcd azdtestazd init --template azure-django-postgres-flexible-appserviceazd auth loginazd up
Onceazd up
finishes, open the Azure portal, navigate to the Azure App Service that was deployed in your new Resource Group and take note of the App Service pricing plan (see the App Service plan's Overview page, Essentials section, "Pricing plan" value).
In step 1 of the Quickstart article, you were instructed to create theazdtest folder. Open that folder in Visual Studio Code.
In the Explorer pane, navigate to theinfra folder. Observe the subfolders and files in theinfra folder.
Themain.bicep file orchestrates the creation of all the services deployed when performing anazd up
orazd provision
. It calls into other files, likedb.bicep andweb.bicep, which in turn call into files contained in the\core subfolder.
The\core subfolder is a deeply nested folder structure containing bicep templates for many Azure services. Some of the files in the\core subfolder are referenced by the three top level bicep files (main.bicep,db.bicep andweb.bicep) and some aren't used at all in this project.
You can scale an existing resource in your deployment by changing its SKU. To demonstrate this, you'll change the App Service plan from the "Basic Service plan" (which is designed for apps with lower traffic requirements and don't need advanced auto scale and traffic management features) to the "Standard Service plan", which is designed for running production workloads.
Note
Not all SKU changes can be made after the fact. Some research may be necessary to better understand your scaling options.
Open theweb.bicep file and locate theappService
module definition. In particular, look for the property setting:
sku: { name: 'B1' }
Change the value fromB1
toS1
as follows:
sku: { name: 'S1' }
Important
As a result of this change, the price per hour will increase slightly. Details about the different service plans and their associated costs can be found on theApp Service pricing page.
Assuming you already have the application deployed in Azure, use the following command to deploy changes to the infrastructure while not redeploying the application code itself.
azd provision
You shouldn't be prompted for a location and subscription. Those values are saved in the.azure<environment-name>.env file where<environment-name>
is the environment name you provided duringazd init
.
Whenazd provision
is complete, confirm your web application still works. Also find the App Service Plan for your Resource Group and confirm that the Pricing Plan is set to the Standard Service Plan (S1).
This concludes the Quickstart, however there are many Azure services that can help you build more scalable and production-ready applications. A great place to start would be to learn aboutAzure API Management,Azure Front Door,Azure CDN, andAzure Virtual Network, to name a few.
Clean up the resources created by the template by running theazd down command.
azd down
Theazd down
command deletes the Azure resources and the GitHub Actions workflow. When prompted, agree to deleting all resources associated with the resource group.
You can also delete theazdtest folder, or use it as the basis for your own application by modifying the files of the project.
azd
templatesazd
commands.azd
to set up a GitHub Actions CI/CD pipeline to redeploy on merge to main branchWas this page helpful?
Was this page helpful?