Bearbeiten

Freigeben über


New-AzApiManagementProduct

Creates an API Management product.

Syntax

New-AzApiManagementProduct
   -Context <PsApiManagementContext>
   [-ProductId <String>]
   -Title <String>
   [-Description <String>]
   [-LegalTerms <String>]
   [-SubscriptionRequired <Boolean>]
   [-ApprovalRequired <Boolean>]
   [-SubscriptionsLimit <Int32>]
   [-State <PsApiManagementProductState>]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

The New-AzApiManagementProduct cmdlet creates an API Management product.

Examples

Example 1: Create a product that does not require a subscription

$apimContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
New-AzApiManagementProduct -Context $apimContext -ProductId "0123456789" -Title "Starter" -Description "Starter Product" -LegalTerms "Free for all" -SubscriptionRequired $False -State "Published"

This command creates an API Management product. No subscription is required.

Example 2: Create a product that requires a subscription and approval

$apimContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
New-AzApiManagementProduct -Context $apimContext -ProductId "9876543210" -Title "Unlimited" -Description "Subscribers have completely unlimited access to the API. Administrator approval is required." -LegalTerms "Free for all" -ApprovalRequired $True -State "Published"

This command creates a product. A subscription and approval are required.

Parameters

-ApprovalRequired

Indicates whether the subscription to the product requires approval or not. By default, this parameter is $False.

Type:Nullable<T>[Boolean]
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Context

Specifies an instance of a PsApiManagementContext object.

Type:PsApiManagementContext
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with azure.

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Description

Specifies the product description.

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

-LegalTerms

Specifies the legal terms of use of the product.

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

-ProductId

Specifies the identifier of new product. If you do not specify this parameter, a new product is generated.

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

-State

Specifies the product state. psdx_paramvalues

  • NotPublished
  • Published The default value is NotPublished.
Type:Nullable<T>[PsApiManagementProductState]
Accepted values:NotPublished, Published
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-SubscriptionRequired

Indicates whether the product requires a subscription. The default value is $True.

Type:Nullable<T>[Boolean]
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-SubscriptionsLimit

Specifies the maximum number of simultaneous subscriptions. The default value is None.

Type:Nullable<T>[Int32]
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Title

Specifies the product title.

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

Inputs

PsApiManagementContext

String

Nullable<T>[[System.Boolean, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]

Nullable<T>[[System.Int32, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]

Nullable<T>[[Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementProductState, Microsoft.Azure.PowerShell.Cmdlets.ApiManagement.ServiceManagement, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]

Outputs

PsApiManagementProduct