While the code here is located in a single repo, the steps are segregated by section folder and are designed to mimic how an organization may break up the deployment of various Azure components across teams, into different code repos or have them run by different pipelines with specific credentials.
The repo contains a single parameters.json file in the Deployment folder. Resource names are all exposed as Bicep parameters with default values. View \Deployment\main.bicep
to see the complete list of resource names and additional parameters. You can run the deployment as-is and accept the default resource names, or you can add override the values in the parameter.json file to values that correspond with your organization's naming convention.
- This deployment scenario requires the following tools installed locally if you intend to execute the deployment from your local machine:
- PowerShell. Click here for instructions on installing PowerShell.
- Azure PowerShell Az Module. Click here for instructions on installing the Azure PowerShell Az Module.
- Azure CLI. Click here for instructions on installing Azure CLI.
- Azure Bicep. Click here for instructions on installing Azure Bicep.
- If Bicep is already installed, ensure you have the latest version by running
az bicep upgrade
- If Bicep is already installed, ensure you have the latest version by running
git clone https://github.com/Azure/azure-spring-apps-reference-architecture.git
az login (Azure CLI) or Connect-AzAccount (PowerShell)
az account list --output table az account set --subscription {name-of-subscription} (Azure CLI) or Set-AzContext -Subscription {id-of-subscription} (PowerShell)
-
If not already registered in the subscription, use the following Azure CLI commands to register the required resource providers for Azure Spring Apps:
- az provider register --namespace 'Microsoft.AppPlatform'
- az provider register --namespace 'Microsoft.ContainerService'
- az provider register --namespace 'Microsoft.ServiceLinker'
-
Modify the variables within the parameters.json files as needed
EXAMPLE - These correspond to the Azure tag key value pairs applied to all resources deployed as part of the landing zone. You could inlcude environment information, team details, or other tags required by your organization
"tags": {
"value": {
"{YourFirstTag}": "{YourFirstTagValue}",
"{YourSecondTag}": "{YourSecondTagValue}",
...
}
}
- Define a local variable called $location and set it to the value of the target region. i.e.
$location = 'eastus'
- Define a local variable called $namePrefix and set it to a value appropriate for your organization. i.e.
$namePrefix = 'myorg'
- Execute deploy_enterpise.ps1 in the Deployment folder
- You will be prompted for the admin password for the jumpbox VM. This value will be stored within Key Vault for secure access at a later time.
- For standard deployments, execute deploy_standard.ps1 in the Deployment folder
You can deploy the current LZA directly in your azure subscription using Azure Dev CLI.
- Using Codespaces via Azure Dev CLI
- Visit https://github.com/Azure/azure-spring-apps-landing-zone-accelerator
- Click on the Green Code button
- Navigate to the CodeSpaces tab and create a new code space
- Open the terminal by pressing Ctrl + `.
- Navigate to the scenario folder using the command cd /workspaces/azure-spring-apps-landing-zone-accelerator/Scenarios/ASA-Secure-Baseline
- Login to Azure using the command azd auth login.
- Use the command azd up to deploy, provide the following to deploy
- environment name (location)
- namePrefix
- subscription
- jumpHostPassword This value will be stored within Key Vault for secure access at a later time. (note the password must be between 8-123 and satisy 3 complex requirements like to have contain an uppercase character, a lowercase character, a numeric digit, a speacial character)
- principalId, You can retrieve this by running the command
az ad sp show --id e8de9221-a19c-4c81-b814-fd37c6caf9d2 --query id --output tsv
- Finally, use the command azd down to clean up resources deployed.
If you have an existing corporate network hub you can override the details of the hub in the main.parameters.json
file and this script will use your existing resource. You will need the contributor role to the the existing hub and/or resource group where the existing hub is deployed. You may also need to modify the subnet prefixes in main.parameters.json
to avoid IP address space collisions with existing subnets. Add the following values to the bottom of the main.parameters.json
file to specify an existing hub VNET:
"deployHub": {
"value": false
},
"hubVnetName": {
"value": "{name-of-your-hub-vnet}"
},
"hubVnetRgName": {
"value": "{name-of-resource-group-containing-your-hub-vnet}"
}
If you have an existing firewall, or you do not have a requirement for egress traffic to route through a firewall, you can override the details of the firewall in the main.parameters.json
file and this script will use your existing resource or not deploy firewall settings at all. Add the following values to the bottom of the main.parameters.json
file:
Option 1: Deploy an Azure Firewall to the LZA
No changes to main.parameters.json
required
Option 2: Use an existing firewall. NOTE: If you use an existing firewall, that firewall needs to implement specific rules to allow Azure Spring Apps to provision and boot strap. See the Azure Spring Apps FQDN requirements/application rules for details.
"firewallIp": {
"value": "{internal-ip-of-your-existing-firewall}"
}
Option 3: Do not configure any firewall
"deployFirewall": {
"value": false
}