Skip to content

Commit

Permalink
Feature/52005 key vault ip update script (#2173)
Browse files Browse the repository at this point in the history
* create build def file

* finish script

* use bash script for azure CLI
  • Loading branch information
GuyHarwood authored Apr 5, 2022
1 parent 73cea4c commit c15ce57
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 3 deletions.
25 changes: 25 additions & 0 deletions deploy/build-defs/add-key-vault-ip.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash
set -e

if [ -z "$1" ]
then
echo "azure key vault instance name required"
exit 1
fi

if [ -z "$2" ]
then
echo "azure resource group name required"
exit 1
fi

if [ -z "$3" ]
then
echo "ip address required"
exit 1
fi

KEY_VAULT_NAME=$1
RES_GRP=$2
IP_ADDRESS=$3
az keyvault network-rule add --name $KEY_VAULT_NAME --resource-group $RES_GRP --ip-address $IP_ADDRESS
13 changes: 13 additions & 0 deletions deploy/build-defs/add-key-vault-ip.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
trigger: none

pool:
name: 'Azure Pipelines'

steps:
- task: AzureCLI@2
displayName: 'Add IPv4 Address to KeyVault'
inputs:
azureSubscription: $(AzureSubscription)
scriptType: bash
scriptPath: 'deploy/build-defs/add-key-vault-ip.sh'
arguments: $(KeyVaultName) $(ResourceGroup) $(IpAddress)
6 changes: 3 additions & 3 deletions deploy/build-defs/rotate-azure-keys.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
inputs:
azureSubscription: $(AzureSubscription)
scriptType: bash
scriptPath: 'deploy/azure/key-vault/key-rotation/redis.sh'
scriptPath: 'deploy/key-rotation/redis.sh'
arguments: $(ResourceGroupName) $(KeyVaultName) $(RedisName) $(KeyType)
failOnStandardError: true
- job: ServiceBusKey
Expand All @@ -36,7 +36,7 @@ jobs:
inputs:
azureSubscription: $(AzureSubscription)
scriptType: bash
scriptPath: 'deploy/azure/key-vault/key-rotation/service-bus.sh'
scriptPath: 'deploy/key-rotation/service-bus.sh'
arguments: $(ResourceGroupName) $(KeyVaultName) $(ServiceBusName) $(KeyType) $(ServiceBusUser)
failOnStandardError: true
- job: StorageAccountKey
Expand All @@ -46,6 +46,6 @@ jobs:
inputs:
azureSubscription: $(AzureSubscription)
scriptType: bash
scriptPath: 'deploy/azure/key-vault/key-rotation/storage.sh'
scriptPath: 'deploy/key-rotation/storage.sh'
arguments: $(ResourceGroupName) $(KeyVaultName) $(StorageAccountName) $(KeyType)
failOnStandardError: true

0 comments on commit c15ce57

Please sign in to comment.