Skip to content

Instantly share code, notes, and snippets.

@papeMK2
Created February 10, 2023 06:53
Show Gist options
  • Save papeMK2/dda8502d948d733bb9066f12c582f217 to your computer and use it in GitHub Desktop.
Save papeMK2/dda8502d948d733bb9066f12c582f217 to your computer and use it in GitHub Desktop.
Create app service and add app configuration data reader role.
resource plan 'Microsoft.Web/serverfarms@2022-03-01' = {
name: 'plan-demo-lab'
location: resourceGroup().location
kind: 'app'
sku: {
name: 'B1'
}
}
resource app 'Microsoft.Web/sites@2022-03-01' = {
name: 'app-demo'
location: resourceGroup().location
kind: 'app'
identity: {
type: 'SystemAssigned'
}
properties: {
serverFarmId: plan.id
}
}
var roleDefinitionAppConfigurationDataReader = subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '516239f1-63e1-4d78-a4de-a74fb236a071')
resource managedId 'Microsoft.Authorization/roleAssignments@2020-10-01-preview' = {
name: guid(app.name, app.id, roleDefinitionAppConfigurationDataReader)
properties: {
principalId: app.identity.principalId
principalType: 'ServicePrincipal'
roleDefinitionId: roleDefinitionAppConfigurationDataReader
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment