-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added function-app-get-system-key.yml (#291)
- Loading branch information
1 parent
91b0f58
commit 9ae1b97
Showing
1 changed file
with
18 additions
and
0 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
azure-pipelines-templates/deploy/step/function-app-get-system-key.yml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
parameters: | ||
ServiceConnection: | ||
FunctionAppName: | ||
OutputVariableName: | ||
|
||
steps: | ||
- task: AzurePowerShell@5 | ||
displayName: 'Set function app ${{ parameters.FunctionAppName }} system key durabletask_extension as secret environment variable' | ||
inputs: | ||
azureSubscription: ${{ parameters.ServiceConnection }} | ||
scriptType: inlineScript | ||
inline: | | ||
$FunctionAppSystemKey = (Get-AzResource -Name ${{ parameters.FunctionAppName }} -ResourceType "Microsoft.Web/sites" | | ||
Invoke-AzResourceAction -Action host/default/listkeys -Force).systemKeys.durabletask_extension | ||
Write-Output "Setting secret variable ${{ parameters.OutputVariableName }}" | ||
Write-Output "##vso[task.setvariable variable=${{ parameters.OutputVariableName }};isreadonly=true;issecret=true]$FunctionAppSystemKey" | ||
pwsh: true | ||
azurePowerShellVersion: LatestVersion |