This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param name string | |
param location string | |
param tags object | |
resource keyVault 'Microsoft.KeyVault/vaults@2022-07-01' = { | |
name: name | |
location: location | |
properties: { | |
enabledForTemplateDeployment: true | |
enableRbacAuthorization: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param name string | |
param location string | |
param tags object | |
@allowed([ | |
'Free' | |
'Standard' | |
]) | |
param sku string = 'Free' | |
param appSettings object = {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Name | Value | |
---|---|---|
ENV_NAME | $env | |
AZ_DEPLOYMENT_NAME | $projectName | |
AZ_PLATFORM_RESOURCE_GROUP_NAME | $resourceGroupName | |
APP_CLIENT_ID | $swaClientId | |
APP_CLIENT_SECRET | $swaClientSecret |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create App Registration that allows only sign-ins from my own organization and has the issuing of id tokens enabled | |
$swaApp = az ad app create --display-name "$($projectName)-$($env)-app" --sign-in-audience "AzureADMyOrg" --enable-id-token-issuance true | ConvertFrom-Json | |
$swaClientId = $swaApp.appId | |
# Create a new secret for the app registration | |
$swaCredential = az ad app credential reset --id $swaApp.id | ConvertFrom-Json | |
$swaClientSecret = $swaCredential.password | |
# Create a new SP attached to the app registration | |
$swaSP = az ad sp create --id $swaApp.appId | ConvertFrom-Json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$serviceConnection = New-Object -TypeName psobject | |
$serviceConnection | Add-Member NoteProperty -Name SubscriptionId -Value $subscriptionId | |
$serviceConnection | Add-Member NoteProperty -Name SubscriptionName -Value $subscriptionName | |
$serviceConnection | Add-Member NoteProperty -Name ServicePrincipalId -Value $azureDevOpsSPObjectId | |
$serviceConnection | Add-Member NoteProperty -Name ServicePrincipalKey -Value $azureDevOpsSPKey | |
$serviceConnection | Add-Member NoteProperty -Name TenantId -Value $tenantId | |
$serviceConnection | Add-Member NoteProperty -Name ServiceConnectionName -Value "$($projectName)-$($env)" | |
$serviceConnection | ConvertTo-Json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$sp = az ad sp create-for-rbac --name "$($projectName)-$($env)" --scopes "/subscriptions/$($subscriptionId)/resourceGroups/$($resourceGroupName)" --role Contributor | ConvertFrom-Json | |
$azureDevOpsSPObjectId = $sp.appId | |
$azureDevOpsSPKey = $sp.password | |
$sp = az ad sp show --id $azureDevOpsSPObjectId --query '{displayName: displayName, principalId: id}' | ConvertFrom-Json | |
$azureDevOpsSPClientId = $sp.principalId | |
az role assignment create --assignee $($azureDevOpsSPClientId) --role 'User Access Administrator' --scope /subscriptions/$($subscriptionId)/resourceGroups/$($resourceGroupName) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
az login -t $tenantId | |
az account set --subscription $subscriptionId | |
az group create --location $location --name $resourceGroupName |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$tenantId = "{YOUR_TENANT_ID}" | |
$subscriptionId = "{YOUR_SUBSCRIPTION_ID}" | |
$subscriptionName = "{YOUR_SUBSCRIPTION_NAME}" | |
$location = "WestEurope" | |
$projectName = "securengdemo" | |
$env = "dev" | |
$resourceGroupName = "rg-$($projectName)-$($env)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module apiEndpoint 'services/frontdoor-endpoint.bicep' = { | |
name: 'deploy-fd-${envName}-api-ep' | |
params: { | |
frontDoorName: frontDoor.outputs.name | |
name: 'ep-${envName}-api' | |
} | |
} | |
module apiDomain 'services/frontdoor-custom-domain.bicep' = { | |
name: 'deploy-fd-${envName}-api-domain' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module docEndpoint 'services/frontdoor-endpoint.bicep' = { | |
name: 'deploy-fd-${envName}-doc-ep' | |
params: { | |
frontDoorName: frontDoor.outputs.name | |
name: 'ep-${envName}-doc' | |
} | |
} | |
module docDomain 'services/frontdoor-custom-domain.bicep' = { | |
name: 'deploy-fd-${envName}-doc-domain' |