This file contains 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
trigger: | |
- main | |
stages: | |
- stage: Build | |
displayName: 'Build and Test' | |
jobs: | |
- job: BuildJob | |
displayName: 'Build Job' | |
pool: |
This file contains 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 location string = resourceGroup().location | |
param appServiceName string = 'app-${uniqueString(resourceGroup().id)}' | |
param appServicePlanName string = 'AppServicePlan-${appServiceName}' | |
param keyVaultName string = 'test-kv-${uniqueString(resourceGroup().id)}' | |
param storageAccountName string = 'teststg${uniqueString(resourceGroup().id)}' | |
param sku string = 'S1' | |
param vnetName string = 'vnet' | |
resource appServicePlan 'Microsoft.Web/serverfarms@2022-03-01' = { | |
name: appServicePlanName |
This file contains 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 storage account create -n mystorageaccount -g MyResourceGroup --kind StorageV2 -l westeurope |
This file contains 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
#User Assigned Managed Identity | |
$ProgressPreference = "SilentlyContinue" | |
$clientId = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' | |
$headers=@{"X-IDENTITY-HEADER"=$env:IDENTITY_HEADER} | |
$resourceUri = ‘https://management.azure.com/' | |
$uri = "$($env:IDENTITY_ENDPOINT)?api-version=2019-08-01&client_id=$clientId&resource=$resourceUri" | |
$response = Invoke-WebRequest -UseBasicParsing -Uri $uri -Headers $headers | |
$content = $response.Content | ConvertFrom-Json | |
$content.access_token |
This file contains 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
#User Assigned Managed Identity | |
$clientId = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' | |
$resourceUri = 'https://management.azure.com/' | |
$uri = "http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&client_id=$clientId&resource=$resourceUri" | |
$response = Invoke-WebRequest -Uri $uri -Method GET -Headers @{Metadata="true"} | |
$content = $response.Content | ConvertFrom-Json | |
$content.access_token | |
#System Assigned Managed Identity | |
$resourceUri = 'https://management.azure.com/' |