Skip to content

Commit

Permalink
format the help markdown file of Az.ApiManagement (#18377)
Browse files Browse the repository at this point in the history
* format the help markdown file of Az.ApiManagement

* update New-AzApiManagementUserToken
  • Loading branch information
CaptainFanZzz authored Jun 22, 2022
1 parent ac860e8 commit a082c8d
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 19 deletions.
16 changes: 9 additions & 7 deletions src/ApiManagement/ApiManagement/help/Backup-AzApiManagement.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,16 @@ Backup-AzApiManagement -ResourceGroupName "ContosoGroup02" -Name "ContosoApi" -S
### Example 2: Back up using Managed Identity

```powershell
PS D:> $storageContext=New-AzStorageContext -StorageAccountName apimbackupmsi
PS D:> $resourceGroupName="contosogroup2";
PS D:> $apiManagementName="contosoapi";
PS D:> $containerName="apimbackupcontainer";
PS D:> $backupName="test-sdk-backup-1";
PS D:> $msiClientId="a6270d0c-7d86-478b-8cbe-dc9047ba54f7"
PS D:> Backup-AzApiManagement -ResourceGroupName $resourceGroupName -Name $apiManagementName -StorageContext $storageContext -TargetContainerName $containerName -TargetBlobName $backupName -AccessType "UserAssignedManagedIdentity" -IdentityClientId $msiClientId -PassThru
$storageContext=New-AzStorageContext -StorageAccountName apimbackupmsi
$resourceGroupName="contosogroup2";
$apiManagementName="contosoapi";
$containerName="apimbackupcontainer";
$backupName="test-sdk-backup-1";
$msiClientId="a6270d0c-7d86-478b-8cbe-dc9047ba54f7"
Backup-AzApiManagement -ResourceGroupName $resourceGroupName -Name $apiManagementName -StorageContext $storageContext -TargetContainerName $containerName -TargetBlobName $backupName -AccessType "UserAssignedManagedIdentity" -IdentityClientId $msiClientId -PassThru
```

```output
PublicIPAddresses : {52.143.79.150}
PrivateIPAddresses :
Id : /subscriptions/4f5285a3-9fd7-40ad-91b1-d8fc3823983d/resourceGroups/contosogroup2/providers/Microsoft.ApiManagement/service/contosoapi
Expand Down
4 changes: 3 additions & 1 deletion src/ApiManagement/ApiManagement/help/Get-AzApiManagement.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,10 @@ This command gets all API Management services within a subscription.
### Example 2: Get an API Management services by a specific name

```powershell
PS D:> Get-AzApiManagement -ResourceGroupName "contosogroup" -Name "contoso"
Get-AzApiManagement -ResourceGroupName "contosogroup" -Name "contoso"
```

```output
PublicIPAddresses : {52.143.79.150}
PrivateIPAddresses :
Id : /subscriptions/4f5285a3-9fd7-40ad-91b1-d8fc3823983d/resourceGroups/contosogroup/providers/Microsoft.ApiManagement/service/contoso
Expand Down
6 changes: 3 additions & 3 deletions src/ApiManagement/ApiManagement/help/New-AzApiManagement.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,9 @@ This command creates a Premium SKU Api Management service in Zones
### Example 6: Create an API Management service in Internal Mode into Virtual Network with Stv2

```powershell
PS D:> $virtualNetwork = New-AzApiManagementVirtualNetwork -SubnetResourceId "/subscriptions/4f5285a3-9fd7-40ad-91b1-d8fc3823983d/resourceGroups/contosogroup/providers/Microsoft.Network/virtualNetworks/apimvnet/subnets/ps"
PS D:> $publicIpAddressId = "/subscriptions/4f5285a3-9fd7-40ad-91b1-d8fc3823983d/resourceGroups/contosogroup/providers/Microsoft.Network/publicIPAddresses/apim-external-vnet-ipv4"
PS D:> New-AzApiManagement -ResourceGroupName "contosogroup" -Location "West US2" -Name "pstestinternalvnet2" -Organization "Contoso" -AdminEmail "[email protected]" -VirtualNetwork $virtualNetwork -VpnType "Internal" -Sku "Premium" -PublicIpAddressId $publicIpAddressId
$virtualNetwork = New-AzApiManagementVirtualNetwork -SubnetResourceId "/subscriptions/4f5285a3-9fd7-40ad-91b1-d8fc3823983d/resourceGroups/contosogroup/providers/Microsoft.Network/virtualNetworks/apimvnet/subnets/ps"
$publicIpAddressId = "/subscriptions/4f5285a3-9fd7-40ad-91b1-d8fc3823983d/resourceGroups/contosogroup/providers/Microsoft.Network/publicIPAddresses/apim-external-vnet-ipv4"
New-AzApiManagement -ResourceGroupName "contosogroup" -Location "West US2" -Name "pstestinternalvnet2" -Organization "Contoso" -AdminEmail "[email protected]" -VirtualNetwork $virtualNetwork -VpnType "Internal" -Sku "Premium" -PublicIpAddressId $publicIpAddressId
```

```output
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ The cmdlet **New-AzApiManagementUserToken** generates a Shared Access Token for

### Example 1: Generate a Shared Access Token for Git User
```powershell
$context = New-AzApiManagementContext -ResourceGroupName powershelltest -ServiceName
powershellsdkservice
$context = New-AzApiManagementContext -ResourceGroupName powershelltest -ServiceName powershellsdkservice
$gitAccess=Get-AzApiManagementTenantAccess -Context $context
New-AzApiManagementUserToken -Context $context -UserId $gitAccess.Id
```
Expand Down
12 changes: 6 additions & 6 deletions src/ApiManagement/ApiManagement/help/Set-AzApiManagement.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ Set-AzApiManagement -InputObject $apim -PassThru
### Example 5: Add Managed Certificate to an APIM Service

```powershell
PS D:> $gateway=New-AzApiManagementCustomHostnameConfiguration -Hostname freecertCanary.contoso.api -HostnameType Proxy -ManagedCertificate
PS D:> $customConfig= @($gateway)
PS D:> $apim=Get-AzApiManagement -ResourceGroupName contosogroup -Name contosoapim
PS D:> $apim.ProxyCustomHostnameConfiguration = $customConfig
PS D:> Set-AzApiManagement -InputObject $apim -PassThru
$gateway=New-AzApiManagementCustomHostnameConfiguration -Hostname freecertCanary.contoso.api -HostnameType Proxy -ManagedCertificate
$customConfig= @($gateway)
$apim=Get-AzApiManagement -ResourceGroupName contosogroup -Name contosoapim
$apim.ProxyCustomHostnameConfiguration = $customConfig
Set-AzApiManagement -InputObject $apim -PassThru
PublicIPAddresses : {20.45.236.81}
Expand Down Expand Up @@ -122,7 +122,7 @@ PublicNetworkAccess : Enabled
PrivateEndpointConnections :
ResourceGroupName : contosogroup
PS D:> $apim.ProxyCustomHostnameConfiguration
$apim.ProxyCustomHostnameConfiguration
CertificateInformation :
EncodedCertificate :
Expand Down

0 comments on commit a082c8d

Please sign in to comment.