This file contains hidden or 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
#!/bin/sh -l | |
# Ensure the workflow fails on error | |
set -e | |
_azure_credentails=$1 | |
_rule_priority_start=$2 | |
_rule_priority_end=$(($2+$3)) | |
_rule_port=$4 | |
_rule_id_for_removal=$5 | |
_rule_nsg_resource_group=$6 | |
_rule_nsg=$7 |
This file contains hidden or 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
FROM mcr.microsoft.com/azure-cli:2.8.0 | |
# Copies your code file from your action repository to the filesystem path `/` of the container. | |
COPY entrypoint.sh /entrypoint.sh | |
# Set the missing exec permission, just in case if you're on on a *nix. | |
RUN chmod +x ./entrypoint.sh | |
# Enable dig to find the runner's public IP | |
RUN apk update && apk add --no-cache bind-tools && rm -rf /var/cache/apk/* | |
# Code file to execute when the docker container starts up (`entrypoint.sh`) | |
ENTRYPOINT ["/entrypoint.sh"] |
This file contains hidden or 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
#connect to the teanant | |
Connect-AzAccount -t 'tenant_id_guid' | |
#get the guids of the subscriptions | |
Get-AzSubscription | |
#use one of the guids from the previous command | |
Select-AzSubscription -SubscriptionId 'subscriptio_id_guid' -TenantId 'tenant_id_guid' | |
#export the everything as CSV |