This reference implementation shows how you can improve the resiliency of an ASE deployment by deploying in multiple availability zones. The standard deployment is also covered. For more information about this scenario, see the reference architecture: High availability enterprise deployment using App Services Environment
- azure-cli 2.37.0 or newer.
-
sqlcmd installed.
-
jq tool installed for your platform:
sudo apt-get install jq
-
dig tool for your platform - Check that you are able to get the public IP, and install dig tool:
sudo apt install dnsutils dig @resolver1.opendns.com ANY myip.opendns.com +short
Run the following commands after providing values for the variables.
Note: RGLOCATION should be in the right format. Some examples of valid locations are westus, eastus, northeurope, westeurope, eastasia, southeastasia, northcentralus, southcentralus, centralus, eastus2, westus2, japaneast, japanwest, brazilsouth.
export RGNAME=yourResourceGroupName
export RGLOCATION=yourLocation
export SQLADMINUSER=yoursqlAdminUser
export JUMPBOX_USER=yourJumpBoxUser
export ADMIN_USER_ID=$(az ad signed-in-user show --query id -o tsv)
Note: For SQL Server administrator password requirements, check Password Policy.
read -s SQLADMINPASSWORD
export SQLADMINPASSWORD
read -s JUMPBOX_PASSWORD
export JUMPBOX_PASSWORD
read -s PFX_PASSWORD
export PFX_PASSWORD
Move to templates directory.
cd templates
Then follow the steps for either standard or high availability deployments.
chmod +x commands_std.azcli
./commands_std.azcli
chmod +x deploy_ha.sh
./deploy_ha.sh
- After deployment ends in the last step, run the following commands to get the resourceURL
echo "{\"id\": \"1\", \"Message\": \"Powered by Azure\", \"MessageType\": \"AD\", \"Url\": \"${RESOURCE_URL}\"}"
The following snippet shows an example of the JSON response:
{"id": "1","Message": "Powered by Azure","MessageType": "AD","Url": "https://webappri.blob.core.windows.net/webappri/Microsoft_Azure_logo_small.png"}
- Open Azure portal, navigate to the resource group of the deployment, and click on Azure Cosmos Db Account.
-
Select Firewall and virtual network, there you can see:
Add IP ranges to allow access from the internet or your on-premises networks. Click on Add my current ip, and save it. In Exceptions section below, check the "Allow access from Azure Protal" option. -
From Cosmos Db Data Explorer, Select cacheContainer, then click on Items. Click on New Item. Replace the whole json payload with above content and click Save.
-
Go to Azure portal and open the resource group of deployment above. Click on Azure Cosmos Db Account, then select Firewall and virtual network, then delete your public ip.
Create SQL server MSI Integration.
-
Run Github Actions to Deploy Web Apps
-
At this point you should be able to test the application:
8.1 For standard deployment, open: https://votingapp-std.contoso.com.
8.2 For high availability deployment, open: https://votingapp-ha.contoso.com.
NOTE: Ignore the certificate validation error on the browser.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.