Skip to content

Instantly share code, notes, and snippets.

View rndazurescript's full-sized avatar

R&D Azure Script rndazurescript

View GitHub Profile
@rndazurescript
rndazurescript / GetAzureEndpoints.ps1
Created September 9, 2020 11:50
Get Azure Portal urls for proxy
Get-AzureRmEnvironment -Name AzureCloud | Format-List
@rndazurescript
rndazurescript / VM-SKUs-With-Acc-Net.azcli
Created October 30, 2020 06:08
Azure VM SKUs with Accelerated Networking capability
az vm list-skus -o json --query '[].{name: name, caps: capabilities[? name==`AcceleratedNetworkingEnabled`]}[].{sku: name, acceleratedNetworking: caps[0].value}[? acceleratedNetworking == `True`]'
@rndazurescript
rndazurescript / GetTokenToListBlobContainer.ps1
Last active February 22, 2021 14:39
Access storage account using managed identity on a VM
$stgaccount="ctenteststg"
$uri="http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https://"+$stgaccount+".blob.core.windows.net"
$token=Invoke-RestMethod -Method GET -Uri $uri -Headers @{"Metadata"="True"}
$listContentUrl="https://"+$stgaccount+".blob.core.windows.net/testdata"
@rndazurescript
rndazurescript / AzureDevOps.yaml
Created April 5, 2021 13:48
Deploy Azure DevOps Agent in ACI
trigger: none
variables:
ResourceGroup: private-endpoint-demos-rg
vnetName: private-endpoint-vnet
vnetResourceGroup: $(ResourceGroup)
agentSubNetName: agents
location: westus2
imageName: azftademo/adoagent:ubuntu-18.04
storageContainerName: 'test'
@rndazurescript
rndazurescript / cleanup.adf.ps1
Created October 4, 2021 14:22
Clean up ADF resources
# Needs more testing. It worked in Azure cloud shell.
$deployResourceGroup="Your-ADF-Resource-Group-Name"
$deployDataFactoryName="Your-ADF-Resource-Name"
# Remove triggers
# If you don't want to remove them, you can comment out the the Remove.
# You will need to stop them, otherwise you will get the following error:
# Resource Microsoft.DataFactory/factories/triggers 'data-factory-name/Blob Created Trigger' failed with
# message '{ "error": { "code": "TriggerEnabledCannotUpdate", "message": "Cannot update enabled Trigger;