-
-
Save johnlokerse/aebba733521b8d387129941c68805df1 to your computer and use it in GitHub Desktop.
Deployment Scripts with Input
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 parSpnName string = 'my-input-parameter' | |
### hidden managed identity resource ### | |
resource resDeploymentScript 'Microsoft.Resources/deploymentScripts@2020-10-01' = { | |
name: 'create-spn-for-kv' | |
location: parLocation | |
kind: 'AzurePowerShell' | |
identity: { | |
type: 'UserAssigned' | |
userAssignedIdentities: { | |
'${resManagedIdentity.id}' : {} | |
} | |
} | |
properties: { | |
azPowerShellVersion: '9.0' | |
retentionInterval: 'P1D' | |
arguments: '-SpnName ${parSpnName}' | |
scriptContent: ''' | |
param ( | |
[string] $SpnName | |
) | |
$spnAppId = New-AzADServicePrincipal -DisplayName $SpnName | Select-Object -ExpandProperty AppId | |
$DeploymentScriptOutputs = @{} | |
$DeploymentScriptOutputs['appId'] = $spnAppId | |
''' | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment