New-AzsSubscription
Create or updates a subscription.
Syntax
New-AzsSubscription
-OfferId <String>
[-SubscriptionId <String>]
[-DisplayName <String>]
[-Id <String>]
[-State <SubscriptionState>]
[-TenantId <String>]
[-DefaultProfile <PSObject>]
[-Confirm]
[-WhatIf]
[<CommonParameters>]
Description
Create or updates a subscription.
Examples
Example 1
PS C:\> New-AzsSubscription -OfferId '/delegatedProviders/default/offers/testoffer' -DisplayName 'testsubscription' | fl *
DisplayName : testsubscription
Id : /subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e
OfferId : /delegatedProviders/default/offers/testoffer
State : Enabled
SubscriptionId : aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e
TenantId : aaaabbbb-0000-cccc-1111-dddd2222eeee
Create a subscription.
Parameters
-Confirm
Prompts you for confirmation before running the cmdlet.
Type: | System.Management.Automation.SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DefaultProfile
The credentials, account, tenant, and subscription used for communication with Azure.
Type: | System.Management.Automation.PSObject |
Aliases: | AzureRMContext, AzureCredential |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DisplayName
Subscription name.
Type: | System.String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Id
Fully qualified identifier.
Type: | System.String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-OfferId
Identifier of the offer under the scope of a delegated provider.
Type: | System.String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-State
Subscription state.
Type: | Microsoft.Azure.PowerShell.Cmdlets.Subscription.Support.SubscriptionState |
Position: | Named |
Default value: | Write-Output "Enabled" |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-SubscriptionId
Id of the subscription.
Type: | System.String |
Position: | Named |
Default value: | $([Guid]::NewGuid().ToString()) |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-TenantId
Directory tenant identifier.
Type: | System.String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: | System.Management.Automation.SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Outputs
Microsoft.Azure.PowerShell.Cmdlets.Subscription.Models.Api20151101.ISubscription