New-​Azure​Rm​Api​Management​Api

Creates an API.

Syntax

New-AzureRmApiManagementApi
   [-ApiId <String>]
   [-AuthorizationScope <String>]
   [-AuthorizationServerId <String>]
   -Context <PsApiManagementContext>
   [-Description <String>]
   -Name <String>
   -Path <String>
   [-ProductIds <String[]>]
   -Protocols <PsApiManagementSchema[]>
   -ServiceUrl <String>
   [-SubscriptionKeyHeaderName <String>]
   [-SubscriptionKeyQueryParamName <String>]
   [<CommonParameters>]

Description

The New-AzureRmApiManagementApi cmdlet creates an Azure API Management API.

Examples

Example 1: Create an API

PS C:\>New-AzureRmApiManagementApi -Context $ApiMgmtContext -Name "Echo api" -ServiceUrl "https://contoso.com/apis/echo" -Protocols @("http", "https") -Path "testapi"

This command creates an API named EchoApi with the specified URL.

Required Parameters

-Context

Specifies a PsApiManagementContext object.

Type:PsApiManagementContext
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Name

Specifies the name of the web API. This is the public name of the API as it appears on the developer and admin portals.

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

Specifies the web API path, which is the last part of the API's public URL and corresponds to the Web API URL suffix field in the admin portal. This URL is used by API consumers to send requests to the web service, and must be one to 400 characters long. The default value is $Null.

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

Specifies an array of web API protocols. Valid values are http, https. These are the web protocols over which the API is made available. The default value is $Null.

Type:PsApiManagementSchema[]
Parameter Sets:Http, Https
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-ServiceUrl

Specifies the URL of the web service that exposes the API. This URL is used only by Azure API Management, and is not made public. The URL must be one to 2000 characters long.

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

Optional Parameters

-ApiId

Specifies the ID of the API to create. If you do not specify this parameter, this cmdlet generates an ID for you.

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

Specifies the OAuth operations scope. The default value is $Null.

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

Specifies the OAuth authorization server ID. The default value is $Null. You must specify this parameter if AuthorizationScope is specified.

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

Specifies a description for the web API.

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

Specifies an array of product IDs to which to add the new API.

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

Specifies the subscription key header name. The default value is $Null.

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

Specifies the subscription key query string parameter name. The default value is $Null.

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

Outputs

Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementApi