Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
Set-AzApiManagementApi
- Module:
- Az.ApiManagement Module
Modifies an API.
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>]
ByInputObject
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
-ApiType
Type of API to create (http, soap, websocket, graphql). This parameter is optional.
Parameter properties
| Type: | |
| Default value: | None |
| Accepted values: | Http, Soap, WebSocket, GraphQL |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-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
-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
-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
-ContactEmail
The email address of the contact person/organization. MUST be in the format of an email address. This parameter is optional.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-ContactName
The identifying name of the contact person/organization. This parameter is optional.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-ContactUrl
The URL pointing to the contact information. MUST be in the format of a URL. This parameter is optional.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-Context
Specifies a PsApiManagementContext object.
Parameter properties
| Type: | PsApiManagementContext |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-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
-Description
Specifies a description for the web API.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-InputObject
Instance of PsApiManagementApi. This parameter is required.
Parameter properties
| Type: | PsApiManagementApi |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-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
-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
-Name
Specifies the name of the web API.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-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
-PassThru
passthru
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-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
-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: | |
| Default value: | None |
| Accepted values: | Http, Https, Ws, Wss |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-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
-SubscriptionKeyHeaderName
Specifies the name of the subscription key header. The default value is $Null.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-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
-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
-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
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.
Inputs
PsApiManagementContext
String
PsApiManagementApi
PsApiManagementSchema
SwitchParameter
Outputs
PsApiManagementApi
Related Links
Azure PowerShell
Feedback
Was this page helpful?
