New-AzApiManagementContext

Creates an instance of PsAzureApiManagementContext.

Syntax

New-AzApiManagementContext
   -ResourceGroupName <String>
   -ServiceName <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
New-AzApiManagementContext
   -ResourceId <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

The New-AzApiManagementContext cmdlet creates an instance of PsAzureApiManagementContext. The context is used for all of the API Management service cmdlets.

Examples

Example 1: Create a PsApiManagementContext instance

PS C:\>$ApiMgmtContext = New-AzApiManagementContext -ResourceGroupName "ContosoResources" -ServiceName "Contoso"

This command creates an instance of PsApiManagementContext.

Parameters

-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
-ResourceGroupName

Specifies the name of the resource group under which an API Management service is deployed.

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

Arm Resource Identifier of a ApiManagement service. This parameter is required.

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

Specifies the name of the deployed API Management service.

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

Inputs

String

Outputs

PsApiManagementContext