Compartilhar via


Set-AzsSubscription

Create or updates a subscription.

Syntax

Set-AzsSubscription
   -SubscriptionId <String>
   [-DisplayName <String>]
   [-Id <String>]
   [-OfferId <String>]
   [-State <SubscriptionState>]
   [-TenantId <String>]
   [-DefaultProfile <PSObject>]
   [-Confirm]
   [-WhatIf]
   [<CommonParameters>]
Set-AzsSubscription
   -SubscriptionDefinition \<ISubscription>
   [-DefaultProfile <PSObject>]
   [-Confirm]
   [-WhatIf]
   [<CommonParameters>]

Description

Create or updates a subscription.

Examples

Example 1

PS C:\> $subscription = Get-AzsSubscription | where DisplayName -eq 'testsubscription'
$subscription.DisplayName = 'update subscription'
$subscription | Set-AzsSubscription | fl *

DisplayName    : update subscription
Id             : /subscriptions/f6f9665e-9831-4ac6-a2c3-26a591b9e6e8
OfferId        : /delegatedProviders/default/offers/TestOffer-fef68214-ba47-469c-89a7-07faf7947ad6
State          : Enabled
SubscriptionId : f6f9665e-9831-4ac6-a2c3-26a591b9e6e8
TenantId       : 6ca57aaf-0074-498a-9c96-2b097515e8cb

Updates 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:False
Accept pipeline input:False
Accept wildcard characters:False

-State

Subscription state.

Type:Microsoft.Azure.PowerShell.Cmdlets.Subscription.Support.SubscriptionState
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-SubscriptionDefinition

List of supported operations. To construct, see NOTES section for SUBSCRIPTIONDEFINITION properties and create a hash table.

Type:Microsoft.Azure.PowerShell.Cmdlets.Subscription.Models.Api20151101.ISubscription
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-SubscriptionId

Id of the subscription.

Type:System.String
Position:Named
Default value:None
Required:True
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

Inputs

Microsoft.Azure.PowerShell.Cmdlets.Subscription.Models.Api20151101.ISubscription

Outputs

Microsoft.Azure.PowerShell.Cmdlets.Subscription.Models.Api20151101.ISubscription

Notes

COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.

SUBSCRIPTIONDEFINITION <ISubscription>: List of supported operations.

  • [DisplayName <String>]: Subscription name.
  • [Id <String>]: Fully qualified identifier.
  • [OfferId <String>]: Identifier of the offer under the scope of a delegated provider.
  • [State <SubscriptionState?>]: Subscription state.
  • [SubscriptionId <String>]: Subscription identifier.
  • [TenantId <String>]: Directory tenant identifier.