Skip to content

Commit b516f71

Browse files
committed
Doc updates and add more test
1 parent 07828fb commit b516f71

File tree

50 files changed

+719
-814
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+719
-814
lines changed

src/ResourceManager/ApiManagement/ChangeLog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
- Set-AzureRmApiManagementBackend Parameter `Password` is changed from String to SecureString
2424

2525
* Breaking Changes in Cmdlet to Create Backend Proxy Object
26-
- New-AzureRmApiManagementBackendProxy Parameter `Password` and `UserName` has been replaced with `ProxyCredentials` of type PSCredential
26+
- New-AzureRmApiManagementBackendProxy Parameter `Password` and `UserName` have been replaced with `ProxyCredentials` of type PSCredential
2727

2828
* Updated Cmdlet Get-AzureRmApiManagementUser to fix issue https://github.com/Azure/azure-powershell/issues/4510
2929

src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/GetAzureApiManagementUser.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,11 @@ public override void ExecuteApiManagementCmdlet()
8989
var user = Client.UserById(Context, UserId);
9090
WriteObject(user);
9191
}
92-
else if (ParameterSetName.Equals(FindBy))
92+
else
9393
{
9494
var user = Client.UsersList(Context, FirstName, LastName, Email, State, GroupId);
9595
WriteObject(user, true);
9696
}
97-
else
98-
{
99-
throw new InvalidOperationException(string.Format("Parameter set name '{0}' is not supported.", ParameterSetName));
100-
}
10197
}
10298
}
10399
}

src/ResourceManager/ApiManagement/Commands.ApiManagement/help/Add-AzureRmApiManagementRegion.md

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -87,25 +87,10 @@ Accept wildcard characters: False
8787
```
8888
8989
### -Location
90-
Specifies the location of the new deployment region.
90+
Specifies the location of the new deployment region amongst the supported region for Api Management service.
9191
92-
Valid values are:
93-
94-
- North Central US
95-
- South Central US
96-
- Central US
97-
- West Europe
98-
- North Europe
99-
- West US
100-
- East US
101-
- East US 2
102-
- Japan East
103-
- Japan West
104-
- Brazil South
105-
- Southeast Asia
106-
- East Asia
107-
- Australia East
108-
- Australia Southeast
92+
To obtain valid locations, use the cmdlet
93+
Get-AzureRmResourceProvider -ProviderNamespace "Microsoft.ApiManagement" | where {$_.ResourceTypes[0].ResourceTypeName -eq "service"} | Select-Object Locations
10994
11095
```yaml
11196
Type: String

src/ResourceManager/ApiManagement/Commands.ApiManagement/help/Get-AzureRmApiManagementApi.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ The **Get-AzureRmApiManagementApi** cmdlet gets one or more Azure API Management
4444
### Example 1: Get all management APIs
4545
```
4646
PS C:\>$ApiMgmtContext = New-AzureRmApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
47-
Get-AzureRmApiManagementApi -Context $ApiMgmtContext
47+
PS C:\>Get-AzureRmApiManagementApi -Context $ApiMgmtContext
4848
```
4949

5050
This command gets all of the APIs for the specified context.

src/ResourceManager/ApiManagement/Commands.ApiManagement/help/Get-AzureRmApiManagementBackend.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Get the details of the Backend.
3232

3333
```
3434
PS C:\>$apimContext = New-AzureRmApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
35-
Get-AzureRmApiManagementBackend -Context $apimContext
35+
PS C:\>Get-AzureRmApiManagementBackend -Context $apimContext
3636
```
3737

3838
Gets a list of all the Backends configured in the Api Management service.
@@ -41,7 +41,7 @@ Gets a list of all the Backends configured in the Api Management service.
4141

4242
```
4343
PS C:\>$apimContext = New-AzureRmApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
44-
Get-AzureRmApiManagementBackend -Context $apimContext -backendId 123
44+
PS C:\>Get-AzureRmApiManagementBackend -Context $apimContext -backendId 123
4545
```
4646

4747
Get the details of the specified Backend identified by the Identifier '123'

src/ResourceManager/ApiManagement/Commands.ApiManagement/help/Get-AzureRmApiManagementIdentityProvider.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,16 @@ Get the identity provider configuration details.
3131
### Example 1: Get all Identity Providers
3232

3333
```
34-
Get-AzureRmApiManagementIdentityProvider -Context $context
34+
PS C:\>$apimContext = New-AzureRmApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
35+
PS C:\>Get-AzureRmApiManagementIdentityProvider -Context $apimContext
3536
```
3637

3738
Get all the identity provider Configuration on the service.
3839

3940
### Get the AAD Type Identity Provider
4041
```
41-
Get-AzureRmApiManagementIdentityProvider -Context $context -Type Aad
42+
PS C:\>$apimContext = New-AzureRmApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
43+
PS C:\>Get-AzureRmApiManagementIdentityProvider -Context $apimContext -Type Aad
4244
```
4345

4446
Gets the Identity Provider Configuration of Azure Active Directory.

src/ResourceManager/ApiManagement/Commands.ApiManagement/help/Get-AzureRmApiManagementProperty.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,10 @@ Get-AzureRmApiManagementProperty -Context <PsApiManagementContext> [-Tag <String
3939

4040
## EXAMPLES
4141

42-
### 1:
42+
### Example 1: Get Property by name
4343
```
44-
PS C:\> Get-AzureRmApiManagementProperty -Context $Context -Name $PropertyName
44+
PS C:\>$apimContext = New-AzureRmApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
45+
PS C:\>Get-AzureRmApiManagementProperty -Context $apimContext -Name "sql-connectionstring"
4546
```
4647

4748
## PARAMETERS

src/ResourceManager/ApiManagement/Commands.ApiManagement/help/Get-AzureRmApiManagementSubscription.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,20 +51,23 @@ This command gets all subscriptions.
5151

5252
### Example 2: Get a subscription with a specified ID
5353
```
54+
PS C:\>$apimContext = New-AzureRmApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
5455
PS C:\>Get-AzureRmApiManagementSubscription -Context $apimContext -SubscriptionId "0123456789"
5556
```
5657

5758
This command gets a subscription by ID.
5859

5960
### Example 3: Get all subscriptions for a user
6061
```
62+
PS C:\>$apimContext = New-AzureRmApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
6163
PS C:\>Get-AzureRmApiManagementSubscription -Context $apimContext -UserId "777"
6264
```
6365

6466
This command gets a user's subscriptions.
6567

6668
### Example 4: Get all subscriptions for a product
6769
```
70+
PS C:\>$apimContext = New-AzureRmApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
6871
PS C:\>Get-AzureRmApiManagementSubscription -Context $apimContext -ProductId "999"
6972
```
7073

src/ResourceManager/ApiManagement/Commands.ApiManagement/help/Get-AzureRmApiManagementTenantAccess.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ The **Get-AzureRmApiManagementTenantAccess** cmdlet gets the tenant access confi
2424

2525
### Example 1: Get tenant access configuration
2626
```
27+
PS C:\>$apimContext = New-AzureRmApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
2728
PS C:\>Get-AzureRmApiManagementTenantAccess -Context $apimContext
2829
```
2930

src/ResourceManager/ApiManagement/Commands.ApiManagement/help/Get-AzureRmApiManagementTenantGitAccess.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ The **Get-AzureRmApiManagementTenantGitAccess** cmdlet gets the Git access confi
2424

2525
### Example 1: Get tenant access configuration
2626
```
27+
PS C:\>$apimContext = New-AzureRmApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
2728
PS C:\>Get-AzureRmApiManagementTenantGitAccess -Context $apimContext
2829
```
2930

src/ResourceManager/ApiManagement/Commands.ApiManagement/help/Get-AzureRmApiManagementTenantSyncState.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ The **Get-AzureRmApiManagementTenantSyncState** cmdlet gets the status of the mo
2424

2525
### Example 1: Get the status of the most recent synchronization
2626
```
27+
PS C:\>$apimContext = New-AzureRmApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
2728
PS C:\>Get-AzureRmApiManagementTenantSyncState -Context $apimContext
2829
```
2930

src/ResourceManager/ApiManagement/Commands.ApiManagement/help/Get-AzureRmApiManagementUser.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,35 +38,39 @@ The **Get-AzureRmApiManagementUser** cmdlet gets a specified user, or all users,
3838

3939
### Example 1: Get all users
4040
```
41+
PS C:\>$apimContext = New-AzureRmApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
4142
PS C:\>Get-AzureRmApiManagementUser -Context $apimContext
4243
```
4344

4445
This command gets all users.
4546

4647
### Example 2: Get a user by ID
4748
```
49+
PS C:\>$apimContext = New-AzureRmApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
4850
PS C:\>Get-AzureRmApiManagementUser -Context $apimContext -UserId "0123456789"
4951
```
5052

5153
This command gets a user by ID.
5254

5355
### Example: Get users by last name
5456
```
57+
PS C:\>$apimContext = New-AzureRmApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
5558
PS C:\>Get-AzureRmApiManagementUser -Context $apimContext -LastName "Fuller"
5659
```
5760

5861
This command gets users that have a specified last name, Fuller.
5962

6063
### Example 4: Get a user by email address
6164
```
62-
PS C:\>Get-AzureRmApiManagementUser -Context $apimContext -Email
63-
65+
PS C:\>$apimContext = New-AzureRmApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
66+
PS C:\>Get-AzureRmApiManagementUser -Context $apimContext -Email "[email protected]"
6467
```
6568

6669
This command gets the user that has the specified email address.
6770

6871
### Example 5: Get all users within a group
6972
```
73+
PS C:\>$apimContext = New-AzureRmApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
7074
PS C:\>Get-AzureRmApiManagementUser -Context $apimContext -GroupId "0001"
7175
```
7276

src/ResourceManager/ApiManagement/Commands.ApiManagement/help/New-AzureRmApiManagement.md

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -122,26 +122,10 @@ Accept wildcard characters: False
122122
```
123123
124124
### -Location
125-
Specifies the location in which this cmdlet creates an API Management deployment.
126-
To obtain valid locations, use the Get-AzureLocation cmdlets.
125+
Specifies the location to create the Api Management service.
127126
128-
Valid values are:
129-
130-
- North Central US
131-
- South Central US
132-
- Central US
133-
- West Europe
134-
- North Europe
135-
- West US
136-
- East US
137-
- East US 2
138-
- Japan East
139-
- Japan West
140-
- Brazil South
141-
- Southeast Asia
142-
- East Asia
143-
- Australia East
144-
- Australia Southeast
127+
To obtain valid locations, use the cmdlet
128+
Get-AzureRmResourceProvider -ProviderNamespace "Microsoft.ApiManagement" | where {$_.ResourceTypes[0].ResourceTypeName -eq "service"} | Select-Object Locations
145129
146130
```yaml
147131
Type: String

src/ResourceManager/ApiManagement/Commands.ApiManagement/help/New-AzureRmApiManagementBackend.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ Creates a new backend entity in Api Management.
2727
### Create Backend 123 with a Basic Authorization Scheme
2828
```
2929
PS C:\>$apimContext = New-AzureRmApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
30-
$credential = New-AzureRmApiManagementBackendCredential -AuthorizationHeaderScheme basic -AuthorizationHeaderParameter opensesame -Query @{"sv" = @('xx', 'bb'); "sr" = @('cc')} -Header @{"x-my-1" = @('val1', 'val2')}
30+
PS C:\>$credential = New-AzureRmApiManagementBackendCredential -AuthorizationHeaderScheme basic -AuthorizationHeaderParameter opensesame -Query @{"sv" = @('xx', 'bb'); "sr" = @('cc')} -Header @{"x-my-1" = @('val1', 'val2')}
3131
32-
$backend = New-AzureRmApiManagementBackend -Context $apimContext -BackendId 123 -Url 'https://contoso.com/awesomeapi' -Protocol http -Title "first backend" -SkipCertificateChainValidation $true -Credential $credential -Description "my backend"
32+
PS C:\>$backend = New-AzureRmApiManagementBackend -Context $apimContext -BackendId 123 -Url 'https://contoso.com/awesomeapi' -Protocol http -Title "first backend" -SkipCertificateChainValidation $true -Credential $credential -Description "my backend"
3333
```
3434

3535
Creates a new Backend

src/ResourceManager/ApiManagement/Commands.ApiManagement/help/New-AzureRmApiManagementBackendCredential.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Creates a new Backend Credential contract.
2424

2525
### Create a Backend Credentials In-Memory Object
2626
```
27-
$credential = New-AzureRmApiManagementBackendCredential -AuthorizationHeaderScheme basic -AuthorizationHeaderParameter opensesame -Query @{"sv" = @('xx', 'bb'); "sr" = @('cc')} -Header @{"x-my-1" = @('val1', 'val2')}
27+
PS C:\>$credential = New-AzureRmApiManagementBackendCredential -AuthorizationHeaderScheme basic -AuthorizationHeaderParameter opensesame -Query @{"sv" = @('xx', 'bb'); "sr" = @('cc')} -Header @{"x-my-1" = @('val1', 'val2')}
2828
```
2929

3030
Creates a Backend Credentials Contract

src/ResourceManager/ApiManagement/Commands.ApiManagement/help/New-AzureRmApiManagementBackendProxy.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ Creates a new Backend Proxy Object which can be piped when creating a new Backen
2323

2424
### Create a Backend Proxy In-Memory Object
2525
```
26-
$secpassword = ConvertTo-SecureString "PlainTextPassword" -AsPlainText -Force
27-
$proxyCreds = New-Object System.Management.Automation.PSCredential ("foo", $secpassword)
28-
$credential = New-AzureRmApiManagementBackendProxy -Url "http://12.168.1.1:8080" -ProxyCredential $proxyCreds
26+
PS C:\>$secpassword = ConvertTo-SecureString "PlainTextPassword" -AsPlainText -Force
27+
PS C:\>$proxyCreds = New-Object System.Management.Automation.PSCredential ("foo", $secpassword)
28+
PS C:\>$credential = New-AzureRmApiManagementBackendProxy -Url "http://12.168.1.1:8080" -ProxyCredential $proxyCreds
2929
```
3030

3131
Creates a Backend Proxy Object

src/ResourceManager/ApiManagement/Commands.ApiManagement/help/New-AzureRmApiManagementContext.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ The context is used for all of the API Management service cmdlets.
2525

2626
### Example 1: Create a PsApiManagementContext instance
2727
```
28-
PS C:\>PS C:\>$ApiMgmtContext = New-AzureRmApiManagementContext -ResourceGroupName "ContosoResources" -ServiceName "Contoso"
28+
PS C:\>$ApiMgmtContext = New-AzureRmApiManagementContext -ResourceGroupName "ContosoResources" -ServiceName "Contoso"
2929
```
3030

3131
This command creates an instance of **PsApiManagementContext**.

src/ResourceManager/ApiManagement/Commands.ApiManagement/help/New-AzureRmApiManagementIdentityProvider.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ Creates a new Identity Provider configuration.
2525

2626
### Example 1: Configures Facebook as an identity Provider for Developer Portal Logins
2727
```
28-
New-AzureRmApiManagementIdentityProvider -Context $apimContext -Type 'Facebook' -ClientId 'sdfsfwerwerw' -ClientSecret 'sdgsdfgfst43tewfewrf'
28+
PS C:\>$apimContext = New-AzureRmApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
29+
PS C:\>New-AzureRmApiManagementIdentityProvider -Context $apimContext -Type 'Facebook' -ClientId 'sdfsfwerwerw' -ClientSecret 'sdgsdfgfst43tewfewrf'
2930
```
3031

3132
This command configures Facebook Identity as a accepted Identity Provider on the Developer Portal of the ApiManagement service.

src/ResourceManager/ApiManagement/Commands.ApiManagement/help/New-AzureRmApiManagementOpenIdConnectProvider.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ The **New-AzureRmApiManagementOpenIdConnectProvider** cmdlet creates an OpenID C
2626

2727
### Example 1: Create a provider
2828
```
29+
PS C:\>$apimContext = New-AzureRmApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
2930
PS C:\>New-AzureRmApiManagementOpenIdConnectProvider -Context $apimContext -OpenIdConnectProviderId "OICProvicer01" -Name "Contoso OpenID Connect Provider" -MetadataEndpointUri "https://openid.provider/configuration" -ClientId "12432143" -Description "OpenID Connect provider description"
3031
```
3132

src/ResourceManager/ApiManagement/Commands.ApiManagement/help/New-AzureRmApiManagementOperation.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,15 @@ The **New-AzureRmApiManagementOperation** cmdlet create an API operation.
2626

2727
### Example 1: Create an API management operation
2828
```
29+
PS C:\>$apimContext = New-AzureRmApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
2930
PS C:\>New-AzureRmApiManagementOperation -Context $apimContext -ApiId $APIId -OperationId "Operation001" -Name "Operation" -Method "GET" -UrlTemplate "/resource" -Description "Use this operation to get resource"
3031
```
3132

3233
This command creates an API management operation.
3334

3435
### Example 2: Create an API management operation with request and response details
3536
```
37+
PS C:\>$apimContext = New-AzureRmApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
3638
PS C:\>$RID = New-Object -TypeName Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementParameter
3739
$RID.Name = "RID"
3840
$RID.Description = "Resource identifier"
@@ -58,7 +60,7 @@ $RequestRepresentation.Sample = '{ "propName": "propValue" }'
5860
$Request.Representations = @($requestRepresentation)
5961
$Response = New-Object -TypeName Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementResponse
6062
$Response.StatusCode = 204
61-
New-AzureRmApiManagementOperation -Context $apimContext -ApiId $APIId -OperationId "01234567890" -Name 'Create/update resource' -Method 'PUT' -UrlTemplate '/resource/{rid}?q={query}' -Description "Use this operation to create new or update existing resource" -TemplateParameters @($rid, $query) -Request $Request -Responses @($response)
63+
PS C:\>New-AzureRmApiManagementOperation -Context $apimContext -ApiId $APIId -OperationId "01234567890" -Name 'Create/update resource' -Method 'PUT' -UrlTemplate '/resource/{rid}?q={query}' -Description "Use this operation to create new or update existing resource" -TemplateParameters @($rid, $query) -Request $Request -Responses @($response)
6264
```
6365

6466
This example creates an API management operation with request and response details.

src/ResourceManager/ApiManagement/Commands.ApiManagement/help/New-AzureRmApiManagementProperty.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ The **New-AzureRmApiManagementProperty** cmdlet creates an Azure API Management
2424

2525
### Example 1: Create a property that includes tags
2626
```
27+
PS C:\>$apimContext = New-AzureRmApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
2728
PS C:\>$Tags = 'sdk', 'powershell'
2829
PS C:\> New-AzureRmApiManagementProperty -Context $apimContext -PropertyId "Property11" -Name "Property Name" -Value "Property Value" -Tags $Tags
2930
```
@@ -34,6 +35,7 @@ The second command creates a property and assigns the strings in $Tags as tags o
3435

3536
### Example 2: Create a property that has a secret value
3637
```
38+
PS C:\>$apimContext = New-AzureRmApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
3739
PS C:\>New-AzureRmApiManagementProperty -Context $apimContext -PropertyId "Property12" -Name "Secret Property -Value "Secret Property Value" -Secret
3840
```
3941

src/ResourceManager/ApiManagement/Commands.ApiManagement/help/New-AzureRmApiManagementRegion.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ Accept wildcard characters: False
8282
```
8383
8484
### -Location
85-
Location of the additional deployment region.
85+
Specifies the location of the new deployment region amongst the supported region for Api Management service.
86+
To obtain valid locations, use the cmdlet
87+
Get-AzureRmResourceProvider -ProviderNamespace "Microsoft.ApiManagement" | where {$_.ResourceTypes[0].ResourceTypeName -eq "service"} | Select-Object Locations
8688
8789
```yaml
8890
Type: String

src/ResourceManager/ApiManagement/Commands.ApiManagement/help/New-AzureRmApiManagementSubscription.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ The **New-AzureRmApiManagementSubscription** cmdlet creates a subscription.
2525

2626
### Example 1: Subscribe a user to a product
2727
```
28+
PS C:\>$apimContext = New-AzureRmApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
2829
PS C:\>New-AzureRmApiManagementSubscription -Context $apimContext -UserId "777" -ProductId "999"
2930
```
3031

src/ResourceManager/ApiManagement/Commands.ApiManagement/help/New-AzureRmApiManagementUser.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ The **New-AzureRmApiManagementUser** cmdlet registers a new user.
2525

2626
### Example 1: Register a new user
2727
```
28-
$securePassword = ConvertTo-SecureString "qwerty" -AsPlainText -Force
29-
New-AzureRmApiManagementUser -Context $apimContext -FirstName "Patti" -LastName "Fuller" -Email "[email protected]" -Password $securePassword
28+
PS C:\>$apimContext = New-AzureRmApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
29+
PS C:\>$securePassword = ConvertTo-SecureString "qwerty" -AsPlainText -Force
30+
PS C:\>New-AzureRmApiManagementUser -Context $apimContext -FirstName "Patti" -LastName "Fuller" -Email "[email protected]" -Password $securePassword
3031
```
3132

3233
This command registers a new user named Patti Fuller.

0 commit comments

Comments
 (0)