Azure: Deploy Custom Role to Subscription - chjgithub/Helps GitHub Wiki
-
Uploaded template.json to blob storage
-
For this process we are going to use PowerShell.
-
Command used to log into Azure CLI:
az login --use-device-code -
Make sure your in the right subscription where you want to deploy the custom role:
Get-AzSubscription -Subscriptionid "[SUBSCRIPTION_ID]" | Select-AzSubscription -
Assign the location to a variable:
$location = Read-Host -Prompt "Enter a location (i.e. centralus)"Output:
Enter a location (i.e. centralus):eastus -
Assign the location to the template file to a variable:
$templateUri = "https://[SA_NAME].blob.core.windows.net/[BUCKET_NAME]/template2.json” -
Issue the deployment to your subscription:
New-AzDeployment -Location $location -TemplateUri $templateUriOutput:
Id : /subscriptions/[SUBSCRIPTION_ID]/providers/Microsoft.Resources/deployments/template2 DeploymentName : template2 Location : eastus ProvisioningState : Succeeded Timestamp : 1/14/2021 3:10:09 AM Mode : Incremental TemplateLink : Uri : https://[SA_NAME].blob.core.windows.net/[BUCKET_NAME]/template2.json ContentVersion : 1.0.0.0 Parameters : Name Type Value ================= ========================= ========== actions Array [ "Microsoft.Compute/virtualMachines/read", "Microsoft.Compute/virtualMachines/start/action", "Microsoft.Compute/virtualMachines/restart/action", "Microsoft.Resources/subscriptions/resourceGroups/read" ] notActions Array [] roleName String Restart Virtual Machines roleDescription String Subscription Level Deployment of a Role Definition Outputs : DeploymentDebugLogLevel :