Set-AzApiManagementApi

Modifies an API.

Syntax

Set-AzApiManagementApi
   -Context <PsApiManagementContext>
   -ApiId <String>
   [-Name <String>]
   [-Description <String>]
   [-ServiceUrl <String>]
   [-Path <String>]
   [-Protocols <PsApiManagementSchema[]>]
   [-AuthorizationServerId <String>]
   [-AuthorizationScope <String>]
   [-OpenIdProviderId <String>]
   [-BearerTokenSendingMethod <String[]>]
   [-SubscriptionKeyHeaderName <String>]
   [-SubscriptionKeyQueryParamName <String>]
   [-SubscriptionRequired]
   [-PassThru]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Set-AzApiManagementApi
   -InputObject <PsApiManagementApi>
   [-Name <String>]
   [-Description <String>]
   [-ServiceUrl <String>]
   [-Path <String>]
   [-Protocols <PsApiManagementSchema[]>]
   [-AuthorizationServerId <String>]
   [-AuthorizationScope <String>]
   [-OpenIdProviderId <String>]
   [-BearerTokenSendingMethod <String[]>]
   [-SubscriptionKeyHeaderName <String>]
   [-SubscriptionKeyQueryParamName <String>]
   [-SubscriptionRequired]
   [-PassThru]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

The Set-AzApiManagementApi cmdlet modifies an Azure API Management API.

Examples

Example 1: Modify an API

PS C:\>$ApiMgmtContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
PS C:\>Set-AzApiManagementApi -Context $ApiMgmtContext -Name "EchoApi" -ServiceUrl "https://contoso.com/apis/echo" -Protocols @('https') -Description "Responds with what was sent" -Path "echo"

Example 2: Add an API to an existing ApiVersionSet

PS C:\>$ApiMgmtContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
PS C:\>$versionSet = New-AzApiManagementApiVersionSet -Context $context -Name "Echo API Version Set" -Scheme Segment -Description "version set sample"
PS C:\>$api = Get-AzApiManagementApi -Context $ApiMgmtContext -ApiId "echo-api"
PS C:\>$api.ApiVersionSetId = $versionSet.Id
PS C:\>$api.ApiVersion = "v1"
PS C:\>$api.ApiVersionSetDescription = $versionSet.Description
PS C:\>Set-AzApiManagementApi -InputObject $api -PassThru

This example adds an API to an existing API Version Set

Example 3: Change the Backend ServiceUrl where the API is pointing to

PS C:\>$ApiMgmtContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
PS C:\>$updatedApiServiceUrl = "http://newechoapi.cloudapp.net/updateapi"
PS C:\>$updatedApi = Set-AzApiManagementApi -Context $ApiMgmtContext -ApiId $echoApiId -ServiceUrl $updatedApiServiceUrl

This example updates the ServiceUrl the echo-api is pointing to.

Parameters

-ApiId

Specifies the ID of the API to modify.

Type:String
Position:Named
Default value:None
Accept pipeline input:True
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
Accept wildcard characters:False
-AuthorizationServerId

Specifies the OAuth authorization server identifier. 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
Accept wildcard characters:False
-BearerTokenSendingMethod

OpenId authorization server mechanism by which access token is passed to the API. Refer to http://tools.ietf.org/html/rfc6749#section-4. This parameter is optional. Default value is $null.

Type:String[]
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
-Context

Specifies a PsApiManagementContext object.

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

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

Type:Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Description

Specifies a description for the web API.

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

Instance of PsApiManagementApi. This parameter is required.

Type:PsApiManagementApi
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
-Name

Specifies the name of the web API.

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

OpenId authorization server identifier. This parameter is optional. Default value is $null. Must be specified if BearerTokenSendingMethods is specified.

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

passthru

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
-Path

Specifies the web API path, which is the last part of the API's public URL. 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
Accept wildcard characters:False
-Protocols

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

Type:Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementSchema[]
Accepted values:Http, Https
Position:Named
Default value:None
Accept pipeline input:True
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
Accept wildcard characters:False
-SubscriptionKeyHeaderName

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

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

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

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

Flag to enforce SubscriptionRequired for requests to the Api. This parameter is optional.

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

Inputs

PsApiManagementContext

String

PsApiManagementApi

Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementSchema[]

SwitchParameter

Outputs

PsApiManagementApi