Skip to content

Instantly share code, notes, and snippets.

View venura9's full-sized avatar
:octocat:
Sup!?

Venura Athukorala venura9

:octocat:
Sup!?
View GitHub Profile
@venura9
venura9 / entrypoint.sh
Last active September 6, 2021 02:56
Manage NSG GitHub Action entrypoint.sh
#!/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
@venura9
venura9 / Dockerfile
Last active September 6, 2021 02:56
Manage NSG GitHub Action Dockerfile
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"]
@venura9
venura9 / get_all_resources_to_csv.ps1
Last active December 1, 2019 23:43
Get all the resources in a subscription to CSV
#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