- defaultTab: nodes description: 'Update or create Azure firewall whitelist rule for IP to access the database' executionEnabled: true id: d63d774f-1302-4ed7-aa50-cdcf1bc96810 loglevel: INFO name: Azure IP whitelist nodeFilterEditable: false options: - label: IP address name: IP regex: ^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.?\b){4}$ required: true - description: Rule name label: firewallRuleName name: firewallRuleName required: true plugins: ExecutionLifecycle: null scheduleEnabled: true sequence: commands: - script: |+ #!/bin/bash json=$(curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -d 'client_id=xxxxxxxxxx&scope=https%3A%2F%2Fmanagement.azure.com%2F.default&client_secret=xxxxxxxxxxxxxxxxxxxxxx&grant_type=client_credentials' 'https://login.microsoftonline.com/xxxxxxxxxxxxxxxxxxxxxxx/oauth2/v2.0/token') token=$(echo ${json} | jq -r '.access_token') curl --location --request PUT 'https://management.azure.com/subscriptions/xxxxxxxxxxxxxxxxx/resourceGroups/Default-SQL-WestEurope/providers/Microsoft.Sql/servers/xxxxxxxxxxxxx/firewallRules/@option.firewallRuleName@?api-version=2021-02-01-preview' --header "Authorization: Bearer ${token}" --header 'Content-Type: application/json' --data-raw '{ "properties": { "startIpAddress": "@option.IP@", "endIpAddress": "@option.IP@" } }' keepgoing: true strategy: node-first uuid: d63d774f-1302-4ed7-aa50-cdcf1bc96810