< Back
New-AzureRmApiManagementApi
Post
NAME New-AzureRmApiManagementApi
SYNOPSIS
Creates an API.
SYNTAX
New-AzureRmApiManagementApi [-ApiId <String>] [-AuthorizationScope <String>] [-AuthorizationServerId <String>] -Context <PsApiManagementContext>
[-DefaultProfile <IAzureContextContainer>] [-Description <String>] -Name <String> -Path <String> [-ProductIds <String[]>] -Protocols {Http |
Https} -ServiceUrl <String> [-SubscriptionKeyHeaderName <String>] [-SubscriptionKeyQueryParamName <String>] [<CommonParameters>]
DESCRIPTION
The New-AzureRmApiManagementApi cmdlet creates an Azure API Management API.
PARAMETERS
-ApiId <String>
Specifies the ID of the API to create. If you do not specify this parameter, this cmdlet generates an ID for you.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-AuthorizationScope <String>
Specifies the OAuth operations scope. The default value is $Null.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-AuthorizationServerId <String>
Specifies the OAuth authorization server ID. The default value is $Null. You must specify this parameter if AuthorizationScope is specified.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-Context <PsApiManagementContext>
Specifies a PsApiManagementContext object.
Required? true
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-DefaultProfile <IAzureContextContainer>
The credentials, account, tenant, and subscription used for communication with azure.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-Description <String>
Specifies a description for the web API.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-Name <String>
Specifies the name of the web API. This is the public name of the API as it appears on the developer and admin portals.
Required? true
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-Path <String>
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.
Required? true
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-ProductIds <String[]>
Specifies an array of product IDs to which to add the new API.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-Protocols <PsApiManagementSchema[]>
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.
Required? true
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-ServiceUrl <String>
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.
Required? true
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-SubscriptionKeyHeaderName <String>
Specifies the subscription key header name. The default value is $Null.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-SubscriptionKeyQueryParamName <String>
Specifies the subscription key query string parameter name. The default value is $Null.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
None
This cmdlet does not accept any input.
OUTPUTS
Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementApi
NOTES
Example 1: Create an API
PS C:\\>$ApiMgmtContext = New-AzureRmApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
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.
RELATED LINKS
Online Version: https://docs.microsoft.com/en-us/powers ... agementapi
Export-AzureRmApiManagementApi
Get-AzureRmApiManagementApi
Import-AzureRmApiManagementApi
Remove-AzureRmApiManagementApi
Set-AzureRmApiManagementApi
SYNOPSIS
Creates an API.
SYNTAX
New-AzureRmApiManagementApi [-ApiId <String>] [-AuthorizationScope <String>] [-AuthorizationServerId <String>] -Context <PsApiManagementContext>
[-DefaultProfile <IAzureContextContainer>] [-Description <String>] -Name <String> -Path <String> [-ProductIds <String[]>] -Protocols {Http |
Https} -ServiceUrl <String> [-SubscriptionKeyHeaderName <String>] [-SubscriptionKeyQueryParamName <String>] [<CommonParameters>]
DESCRIPTION
The New-AzureRmApiManagementApi cmdlet creates an Azure API Management API.
PARAMETERS
-ApiId <String>
Specifies the ID of the API to create. If you do not specify this parameter, this cmdlet generates an ID for you.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-AuthorizationScope <String>
Specifies the OAuth operations scope. The default value is $Null.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-AuthorizationServerId <String>
Specifies the OAuth authorization server ID. The default value is $Null. You must specify this parameter if AuthorizationScope is specified.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-Context <PsApiManagementContext>
Specifies a PsApiManagementContext object.
Required? true
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-DefaultProfile <IAzureContextContainer>
The credentials, account, tenant, and subscription used for communication with azure.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-Description <String>
Specifies a description for the web API.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-Name <String>
Specifies the name of the web API. This is the public name of the API as it appears on the developer and admin portals.
Required? true
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-Path <String>
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.
Required? true
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-ProductIds <String[]>
Specifies an array of product IDs to which to add the new API.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-Protocols <PsApiManagementSchema[]>
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.
Required? true
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-ServiceUrl <String>
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.
Required? true
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-SubscriptionKeyHeaderName <String>
Specifies the subscription key header name. The default value is $Null.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-SubscriptionKeyQueryParamName <String>
Specifies the subscription key query string parameter name. The default value is $Null.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
None
This cmdlet does not accept any input.
OUTPUTS
Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementApi
NOTES
Example 1: Create an API
PS C:\\>$ApiMgmtContext = New-AzureRmApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
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.
RELATED LINKS
Online Version: https://docs.microsoft.com/en-us/powers ... agementapi
Export-AzureRmApiManagementApi
Get-AzureRmApiManagementApi
Import-AzureRmApiManagementApi
Remove-AzureRmApiManagementApi
Set-AzureRmApiManagementApi