Set-AzureRmApiManagementApi

Modifies an API.

Warning

The AzureRM PowerShell module has been officially deprecated as of February 29, 2024. Users are advised to migrate from AzureRM to the Az PowerShell module to ensure continued support and updates.

Although the AzureRM module may still function, it's no longer maintained or supported, placing any continued use at the user's discretion and risk. Please refer to our migration resources for guidance on transitioning to the Az module.

Syntax

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

Description

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

Examples

Example 1 Modify an API

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

Parameters

-ApiId

Specifies the ID of the API to modify.

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

-Context

Specifies a PsApiManagementContext object.

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

-DefaultProfile

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

Type:IAzureContextContainer
Aliases:AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Description

Specifies a description for the web API.

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

-InputObject

Instance of PsApiManagementApi. This parameter is required.

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

-Name

Specifies the name of the web API.

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

-PassThru

passthru

Type:SwitchParameter
Position:Named
Default value:None
Required:False
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
Required:False
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:PsApiManagementSchema[]
Accepted values:Http, Https
Position:Named
Default value:None
Required:True
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
Required:True
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
Required:False
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
Required:False
Accept pipeline input:True
Accept wildcard characters:False

Inputs

PsApiManagementContext

String

PsApiManagementApi

Parameters: InputObject (ByValue)

PsApiManagementSchema[]

SwitchParameter

Outputs

PsApiManagementApi