New-AzureRmApiManagementApiVersionSet
Creates an API Version Set.
Caution
Because Az PowerShell modules now have all the capabilities of AzureRM PowerShell modules and more, we'll retire AzureRM PowerShell modules on 29 February 2024.
To avoid service interruptions, update your scripts that use AzureRM PowerShell modules to use Az PowerShell modules by 29 February 2024. To automatically update your scripts, follow the quickstart guide.
Syntax
New-AzureRmApiManagementApiVersionSet
-Context <PsApiManagementContext>
[-ApiVersionSetId <String>]
-Name <String>
-Scheme <PsApiManagementVersioningScheme>
[-HeaderName <String>]
[-QueryName <String>]
[-Description <String>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The New-AzureRmApiManagementApiVersionSet cmdlet creates an API Version set entity in the Azure API Management context.
Examples
Example 1
PS C:\>$ApiMgmtContext = New-AzureRmApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
PS C:\> New-AzureRmApiManagementApiVersionSet -Context $ApiMgmtContext -Name "newversion" -Scheme Header -HeaderName "x-ms-version" -Description "version by xmsversion"
ApiVersionSetId : ea9a87cd-a699-4a75-bf7d-909846b91268
Description : version by xmsversion
VersionQueryName :
VersionHeaderName : x-ms-version
DisplayName : newversion
VersioningScheme : Header
Id : /subscriptions/subid/resourceGroups/Api-Default-WestUS/providers/Microsoft.ApiManagement/service/contoso/api-version-sets/ea9a87cd-a699-4a75-bf7d-909846b91268
ResourceGroupName : Api-Default-WestUS
ServiceName : contoso
This command creates an API Version Set which versioning scheme Query
and Query parameter api-version
.
Parameters
-ApiVersionSetId
Identifier for new API Version Set. This parameter is optional. If not specified an identifier will be generated.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Confirm
Prompts you for confirmation before running the cmdlet.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Context
Instance of PsApiManagementContext. This parameter is required.
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
Description of the Api Version set.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-HeaderName
The Header value which will contain the versioning information. If versioning Scheme HEADER is choosen, then this value must be specified.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Name
The name of the ApiVersion Set. This parameter is required.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-QueryName
The Query value which will contain the versioning information. If versioning Scheme Query is choosen, then this value must be specified.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Scheme
Versioning Scheme to select for the Api Versioning Set. This parameter is required.
Type: | PsApiManagementVersioningScheme |
Accepted values: | Segment, Query, Header |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Inputs
Parameters: Context (ByValue)
PsApiManagementVersioningScheme