Azure Cloud Shell has an up to date PowerShell instance
az account show
az account set --subscription
az role assignment create --assignee -g --role Contributor
Set-AzureRmContext -SubscriptionId
az webapp update --name --resource-group --client-affinity-enabled=false
az functionapp create -g -n -s --runtime dotnet --runtime dotnet --functions-version 3 --consumption-plan-location eastus2 --app-insights
az webapp create -g -p --runtime 'DOTNETCORE|3.1' -n
az monitor app-insights component create --app --location <location(eastus2)> --kind web -g --application-type web --retention-time 30
az webapp config set --name --resource-group --use-32bit-worker-process false
az webapp update --name --resource-group --client-affinity-enabled=false
(Get-AzureRmWebApp -ResourceGroupName ).GetEnumerator() | Start-AzureRmWebApp (Get-AzureRmWebApp -ResourceGroupName ).GetEnumerator() | Stop-AzureRmWebApp (Get-AzureRmWebApp -ResourceGroupName ).GetEnumerator() | Restart-AzureRmWebApp
$storageAccount = Get-AzureRmStorageAccount -ResourceGroupName -Name $ctx = $storageAccount.Context
Set-AzureStorageContainerAcl -Name $Container.Name -Context $ctx -Permission Blob -PassThru #Blob/Container/Off
Set-AzureRmWebApp -Name "" -ResourceGroupName "" -AppServicePlan ""
assign existing service principal to new scope / add access permission for existing service principal to new resource group
it runs against the selected subscription. Service Principals are created at Active Directory level and can be associated across the tenant resources
New-AzureRmRoleAssignment -RoleDefinitionName Contributor -ServicePrincipalName -ResourceGroupName -via cli method az role assignment create --assignee --resource-group --role Contributor
az functionapp create -g -n -s --runtime dotnet --consumption-plan-location --app-insights --runtime dotnet --version 3.1
azcopy copy 'https://.blob.core.windows.net/' 'https://.blob.core.windows.net/' --recursive --s2s-preserve-access-tier=false
azcopy copy 'https://.blob.core.windows.net///*' 'https://.blob.core.windows.net///' --recursive --s2s-preserve-access-tier=false
- via az REST API az rest --method DELETE --url https://graph.microsoft.com/v1.0/applications/ -via cli method az ad app delete --id
- az webapp config ssl list --resource --out tsv --query '[].[thumbprint,resourceGroup,expirationDate,issueDate,issuer,subjectName]' > .csv
- download -- example: "download ssl-list.csv"
- az webapp config ssl delete -g --certificate-thumbprint
az webapp config show --name --resource-group --query '{name:name,use32BitWorkerProcess:use32BitWorkerProcess,netFrameworkVersion:netFrameworkVersion,http20Enabled:http20Enabled, alwaysOn:alwaysOn}' -o table
- az role assignment delete --role "C-Application Insights Reader"
- az role definition delete --name "C-Application Insights Reader"
- az role definition update --role-definition ./custom-role-application-insights-reader.json
####------ sample definition ------ ####------------------------------- { "assignableScopes": [ "/subscriptions/f73276ac-a000-462e-bb5b-d3c582ee19ef" ], "description": "This role allows access to Application Insights only", "id": "/subscriptions/f73276ac-a000-462e-bb5b-d3c582ee19ef/providers/Microsoft.Authorization/roleDefinitions/6672e0e3-8beb-4d4f-8cb1-f04ca006578c", "name": "6672e0e3-8beb-4d4f-8cb1-f04ca006578c", "permissions": [ { "actions": [ "Microsoft.Authorization//read", "Microsoft.Insights/alertRules/", "Microsoft.Insights/components/", "Microsoft.Insights/webtests/", "Microsoft.ResourceHealth/availabilityStatuses/read", "Microsoft.Resources/deployments/*", "Microsoft.Resources/subscriptions/resourceGroups/read", ], "dataActions": [], "notActions": [], "notDataActions": [] } ], "roleName": "C-Application Insights Reader", "roleType": "CustomRole", "type": "Microsoft.Authorization/roleDefinitions" }
{ "properties": { "DisableIpMasking": true } }
az rest --method patch --url https://management.azure.com/subscriptions//resourceGroups//providers/microsoft.insights/components/?api-version=2018-05-01-preview --headers Content-Type=application/json --body @body.json
az functionapp update -n -g --set httpsOnly=true; //# add --slot for updating the slot property
az resource update -n -g --resource-type Microsoft.web/sites --api-version 2021-03-01 --set properties.serverFarmId="/subscriptions//resourceGroups//providers/Microsoft.Web/serverfarms/"
az resource update -n -g --resource-type Microsoft.web/sites --set properties.sku="PremiumV3" // change the SKU according to the desired App Service Plan
az webapp vnet-integration add -g -n --vnet --subnet ;
az webapp config set -g -n --vnet-route-all-enabled false
az webapp vnet-integration remove -g -n
npm install -g redis-cli rdcli -h -p 6380 -a --tls true
az keyvault secret set --n --vault-name --value
az keyvault secret delete -n --vault-name
az appconfig kv set -n --key --value --yes
az storage blob download-batch -d . --pattern . -s --account-name --account-key
az resource update --ids --set properties.disableIpMasking=true