Create and output a new Service Principal with password
$sp = NewAzADServicePrincipal -DisplayName "{sp-name}" -Role "{role}"
$sp
$credentials = New-Object pscredential -ArgumentList "temp", $sp.Secret
$credentials.GetNetworkCredential().password
Get subscriptions that the current account can access.
The Get-AzSubscription cmdlet gets the subscription ID, subscription name, and home tenant for subscriptions that the current account can access.
Get all subscriptions in all tenants
PS C:\>Get-AzSubscription
Get all subscriptions for a specific tenant
PS C:\>Get-AzSubscription -TenantId "aaaa-aaaa-aaaa-aaaa"
Module: Az.Resources
Creates a new Template Spec version with the specified ARM Template content. The content can either come from a raw JSON string (using FromJsonStringParameterSet parameter set) or from a specified JSON/Bicep file (using FromJsonFileParameterSet parameter set).
The following example creates a new Template Spec version "v1.0" in a Template Spec named "myTemplateSpec". The specified version will have $templateJson as the version's ARM Template content.
$templateJson = @" { "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "parameters": {}, "resources": [] } "@ New-AzTemplateSpec -ResourceGroupName 'myRG' -Name 'myTemplateSpec' -Version 'v1.0' -Location 'West US' -TemplateJson $templateJson
Additional details at New-AzTemplateSpec (Az.Resources) | Microsoft Docs
Comments