Discover and manage your Azure API Management services with the Az.ApiManagement module.
Module Overview
The Az.ApiManagement module provides cmdlets to manage Azure API Management services. You can use this module to perform various operations, including creating, configuring, and monitoring your API Management instances.
Key features include:
Service creation and configuration
API and operation management
Product and subscription management
Policy editing and deployment
Developer portal customization
Monitoring and diagnostics
Getting Started
To use the Az.ApiManagement cmdlets, you first need to install the Azure PowerShell module and then import the Az.ApiManagement module.
# Install Azure PowerShell module (if not already installed)
Install-Module -Name Az -AllowClobber -Scope CurrentUser
# Connect to your Azure account
Connect-AzAccount
# Import the API Management module
Import-Module Az.ApiManagement
Once connected and the module is imported, you can start using the cmdlets.
Cmdlets Reference
Explore the extensive list of cmdlets available in the Az.ApiManagement module to manage your API Management resources.
Service Management
Cmdlets for creating, updating, and deleting API Management services.
See how to use common cmdlets to manage your API Management resources.
# Example 1: Create a new API Management service
New-AzApiManagement -ResourceGroupName "MyResourceGroup" -Name "my-apim-service" -Location "West US" -Sku "Developer"
# Example 2: Get all APIs for a service
Get-AzApiManagementApi -ApiManagementServiceName "my-apim-service" -ResourceGroupName "MyResourceGroup"
# Example 3: Set a policy for a specific API operation
$policyXml = @"
<policies>
<inbound>
<base />
<set-header name="X-Powered-By" exists-action="override">
<value>Azure API Management</value>
</set-header>
</inbound>
<backend>
<base />
</backend>
<outbound>
<base />
</outbound>
<on-error>
<base />
</on-error>
</policies>
"@
Set-AzApiManagementPolicy -ApiManagementServiceName "my-apim-service" -ResourceGroupName "MyResourceGroup" -ApiId "my-api-id" -Policy $policyXml
# Example 4: Create a new product
New-AzApiManagementProduct -ApiManagementServiceName "my-apim-service" -ResourceGroupName "MyResourceGroup" -ProductId "bronze" -DisplayName "Bronze Tier" -Description "Basic access tier." -SubscriptionRequired $true