New-​Azure​RM​Plan

Creates a new plan comprising the various quotas of the resource provider.

Syntax

New-AzureRMPlan
   -ArmLocation <String>
   [-DisplayName <String>]
   [-InformationAction <ActionPreference>]
   [-InformationVariable <String>]
   -Name <String>
   [-PipelineVariable <String>]
   [-QuotaIds <String[]>]
   -ResourceGroup <String>
   [-SkuIds <String[]>]
   [<CommonParameters>]

Description

The New-AzureRmPlan cmdlet creates a new plan comprising the various quotas of the resource provider.

Examples

Example 1: Create a plan

$quotaIds = @()
$computeQuota = New-ComputeQuota -QuotaName "Basic" -Location "local"
$quotaIds += $computeQuota.Id
# Add other resource provider quotas if needed

New-AzureRMPlan -Name $PlanName -DisplayName "ComputePlan" -ArmLocation "local" -ResourceGroup $ResourceGroupName -QuotaIds $quotaIds

function New-ComputeQuota
{
param
(
\[parameter(Mandatory=$true)\]
\[string\] $QuotaName,
\[parameter(Mandatory=$true)\]
\[string\] $Location,
\[int\] $VirtualMachineCount = 2,
\[int\] $MemoryLimitMB = 2048,
\[int\] $CoresLimit = 2,
\[string\] $ApiVersion = "2015-12-01-preview"
)

Write-Verbose "Creating compute quota named $QuotaName"
$uri = "{0}subscriptions/{1}/providers/Microsoft.Compute.Admin/locations/{2}/quotas/{3}?api-version={4}" -f $AdminUri, $SubscriptionId, $Location, $QuotaName, $ApiVersion

$RequestBody = @"
{
"name":"$quotaName",
"type":"Microsoft.Compute.Admin/quotas",
"location":"$Location",
"properties":{
"virtualMachineCount":$VirtualMachineCount,
"memoryLimitMB":$MemoryLimitMB,
"coresLimit":$CoresLimit
}
}
"@

# Get the $Token with Get-AzureStackToken cmdlet
$headers = @{ "Authorization" = "Bearer "+ $Token }

$quota = Invoke-RestMethod -Method Put -Uri $uri -Body $RequestBody -ContentType 'application/json' -Headers $headers

Write-Output $quota
}

This example creates a plan with the display name "ComputePlan" and the quota IDs contained in the $quotaIds variable.

Required Parameters

-ArmLocation

Specifies the location of the Azure stack resource manager in the Azure stack installation.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Name

Specifies the name of the plan.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ResourceGroup

Specifies the name of the resource group under which the plan resource is created.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Optional Parameters

-DisplayName

Specifies the display name of the plan.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-InformationAction

Specifies how this cmdlet responds to an information event.

Type:ActionPreference
Aliases:infa
Parameter Sets:SilentlyContinue, Stop, Continue, Inquire
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-InformationVariable

Specifies a variable that is used for storing an informational message.

Type:String
Aliases:iv
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-PipelineVariable

Specifies a variable that stores the value of the current pipeline element.

Type:String
Aliases:pv
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-QuotaIds

Specifies an array of quota IDs. The resource providers create the quotas and provide the IDs.

Type:String[]
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-SkuIds

An array of SKU IDs from the resource provider.

Type:String[]
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Inputs

None

Outputs

Microsoft.AzureStack.Management.Models.AdminPlanModel