New-AzApiManagementContext
建立 PsAzureApiManagementContext 的實例。
Syntax
New-AzApiManagementContext
-ResourceGroupName <String>
-ServiceName <String>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
New-AzApiManagementContext
-ResourceId <String>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
New-AzApiManagementContext Cmdlet 會建立 PsAzureApiManagementContext 的實例。 內容會用於所有 API 管理 服務 Cmdlet。
範例
範例 1:建立 PsApiManagementContext 實例
$ApiMgmtContext = New-AzApiManagementContext -ResourceGroupName "ContosoResources" -ServiceName "Contoso"
此命令會建立 PsApiManagementContext 的實例。
參數
-DefaultProfile
用於與 azure 通訊的認證、帳戶、租用戶和訂用帳戶。
Type: | IAzureContextContainer |
Aliases: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ResourceGroupName
指定部署 API 管理 服務的資源群組名稱。
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ResourceId
ApiManagement 服務的 Arm 資源識別碼。 此為必要參數。
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ServiceName
指定已部署 API 管理 服務的名稱。
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |