Set-AzApiManagementApi
Syntax
ExpandedParameter (Default)
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]
[-ApiType <PsApiManagementApiType>]
[-TermsOfServiceUrl <String>]
[-ContactName <String>]
[-ContactUrl <String>]
[-ContactEmail <String>]
[-LicenseName <String>]
[-LicenseUrl <String>]
[-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]
[-ApiType <PsApiManagementApiType>]
[-TermsOfServiceUrl <String>]
[-ContactName <String>]
[-ContactUrl <String>]
[-ContactEmail <String>]
[-LicenseName <String>]
[-LicenseUrl <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
The Set-AzApiManagementApi cmdlet modifies an Azure API Management API.
Examples
Example 1: Modify an API
$ApiMgmtContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
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
$ApiMgmtContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
$versionSet = New-AzApiManagementApiVersionSet -Context $context -Name "Echo API Version Set" -Scheme Segment -Description "version set sample"
$api = Get-AzApiManagementApi -Context $ApiMgmtContext -ApiId "echo-api"
$api.ApiVersionSetId = $versionSet.Id
$api.ApiVersion = "v1"
$api.ApiVersionSetDescription = $versionSet.Description
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
$ApiMgmtContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
$updatedApiServiceUrl = "http://newechoapi.cloudapp.net/updateapi"
$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.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ExpandedParameter
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-ApiType
Type of API to create (http, soap, websocket, graphql). This parameter is optional.
Parameter properties
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-AuthorizationScope
Specifies the OAuth operations scope.
The default value is $Null.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-AuthorizationServerId
Specifies the OAuth authorization server identifier.
The default value is $Null.
You must specify this parameter if AuthorizationScope is specified.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-BearerTokenSendingMethod
OpenId authorization server mechanism by which access token is passed to the API. Refer to https://datatracker.ietf.org/doc/html/rfc6749#section-4 . This parameter is optional. Default value is $null.
Parameter properties
Type: String [ ]
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
The email address of the contact person/organization. MUST be in the format of an email address. This parameter is optional.
Type: String
Default value: None
Supports wildcards: False
DontShow: False
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
The identifying name of the contact person/organization. This parameter is optional.
Type: String
Default value: None
Supports wildcards: False
DontShow: False
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
The URL pointing to the contact information. MUST be in the format of a URL. This parameter is optional.
Type: String
Default value: None
Supports wildcards: False
DontShow: False
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-Context
Specifies a PsApiManagementContext object.
Parameter properties
Parameter sets
ExpandedParameter
Position: Named
Mandatory: True
Value from pipeline: True
Value from pipeline by property name: True
Value from remaining arguments: False
-DefaultProfile
The credentials, account, tenant, and subscription used for communication with azure.
Parameter properties
Type: IAzureContextContainer
Default value: None
Supports wildcards: False
DontShow: False
Aliases: AzContext, AzureRmContext, AzureCredential
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Description
Specifies a description for the web API.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
Instance of PsApiManagementApi. This parameter is required.
ByInputObject
Position: Named
Mandatory: True
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
-LicenseName
The license name used for the API. This parameter is optional.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-LicenseUrl
A URL to the Terms of Service for the API. This parameter is optional.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-Name
Specifies the name of the web API.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-OpenIdProviderId
OpenId authorization server identifier. This parameter is optional. Default value is $null. Must be specified if BearerTokenSendingMethods is specified.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-PassThru
passthru
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: 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.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: 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.
Parameter properties
Type: PsApiManagementSchema [ ]
Default value: None
Accepted values: Http, Https, Ws, Wss
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: 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.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
Specifies the name of the subscription key header.
The default value is $Null.
Type: String
Default value: None
Supports wildcards: False
DontShow: False
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-SubscriptionKeyQueryParamName
Specifies the name of the subscription key query string parameter.
The default value is $Null.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-SubscriptionRequired
Flag to enforce SubscriptionRequired for requests to the Api. This parameter is optional.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-TermsOfServiceUrl
A URL to the Terms of Service for the API. This parameter is optional.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters .
Outputs