Skip to content

Aladdin generated examples for ApiManagement, DevTestLabs, EventHub, LogicApp, ServiceBus #12064

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ The **Get-AzApiManagementApiSchema** cmdlet gets the details of the API Schema

## EXAMPLES

### Example 1 : Get the details of all the Api Schema of an Api
### Example 1: Get the details of all the Api Schema of an Api
```powershell
PS D:\github\azure-powershell> $context = New-AzApiManagementContext -ResourceId /subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.ApiManagement/service/sdktestapim4163
PS D:\github\azure-powershell> Get-AzApiManagementApiSchema -Context $context -ApiId wsdlapitest
Expand All @@ -47,7 +47,7 @@ Schema Document : <?xml version=""1.0"" encoding=""UTF-8""....

This command gets all the API schemas associated with an Api `swagger-petstore-extensive` for particular ApiManagement Context.

### Example 2 : Get the specific schema associated with an Api
### Example 2: Get the specific schema associated with an Api
```powershell
PS D:\github\azure-powershell> $context = New-AzApiManagementContext -ResourceId /subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.ApiManagement/service/sdktestapim4163
PS D:\github\azure-powershell> Get-AzApiManagementApiSchema -Context $context -ApiId swagger-petstore-extensive -SchemaId 5cc9cf67e6ed3b1154e638bd
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ The **Get-AzApiManagementApiVersionSet** cmdlet gets the details of the API Vers

### Example 1

### Example 1: Get all API Version Sets
### Example 2: Get all API Version Sets
```powershell
PS C:\>$ApiMgmtContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
PS C:\>Get-AzApiManagementApiVersionSet -Context $ApiMgmtContext
Expand Down Expand Up @@ -70,7 +70,7 @@ ServiceName : contoso

This command gets all of the API Version sets for the specified context.

### Example 2: Get a API Version Set by ID
### Example 3: Get a API Version Set by ID
```powershell
PS C:\>$ApiMgmtContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
PS C:\>Get-AzApiManagementApiVersionSet -Context $ApiMgmtContext -ApiVersionSetId $ApiVersionSetId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ Get the identity provider client secret.

## EXAMPLES

### Example 2: Get the client secret of AAD Type Identity Provider
```
### Example 1: Get the client secret of AAD Type Identity Provider
```powershell
PS C:\>$apimContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
PS C:\> Get-AzApiManagementIdentityProviderClientSecret -Context $apimContext -Type Aad
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,39 +56,39 @@ Keys will not be included into result details. To get keys, use **Get-AzApiManag
## EXAMPLES

### Example 1: Get all subscriptions
```
```powershell
PS C:\>$apimContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-East-US" -ServiceName "contoso"
PS C:\>Get-AzApiManagementSubscription -Context $apimContext
```

This command gets all subscriptions.

### Example 2: Get a subscription with a specified ID
```
```powershell
PS C:\>$apimContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-East-US" -ServiceName "contoso"
PS C:\>Get-AzApiManagementSubscription -Context $apimContext -SubscriptionId "0123456789"
```

This command gets a subscription by ID.

### Example 3: Get all subscriptions for a user
```
```powershell
PS C:\>$apimContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-East-US" -ServiceName "contoso"
PS C:\>Get-AzApiManagementSubscription -Context $apimContext -UserId "777"
```

This command gets a user's subscriptions.

### Example 4: Get all subscriptions for a product
```
```powershell
PS C:\>$apimContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-East-US" -ServiceName "contoso"
PS C:\>Get-AzApiManagementSubscription -Context $apimContext -ProductId "999"
```

This command gets all subscriptions for the product.

### Example 5: Get all subscriptions for a Scope
```
```powershell
PS C:\>$apimContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-East-US" -ServiceName "contoso"
PS C:\>Get-AzApiManagementSubscription -Context $apimContext -Scope "/apis"
Expand All @@ -115,8 +115,8 @@ ServiceName : contoso

This command gets all subscriptions which are configured for global api scope

### Example 5: Get all subscriptions for a product and user scope
```
### Example 6: Get all subscriptions for a product and user scope
```powershell
PS C:\>$apimContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-East-US" -ServiceName "contoso"
PS C:\>Get-AzApiManagementSubscription -Context $apimContext -ProductId 59b872f28a82740f547e6270 -UserId 1
Expand Down
12 changes: 6 additions & 6 deletions src/ApiManagement/ApiManagement/help/Get-AzApiManagementUser.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,39 +38,39 @@ The **Get-AzApiManagementUser** cmdlet gets a specified user, or all users, if n
## EXAMPLES

### Example 1: Get all users
```
```powershell
PS C:\>$apimContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
PS C:\>Get-AzApiManagementUser -Context $apimContext
```

This command gets all users.

### Example 2: Get a user by ID
```
```powershell
PS C:\>$apimContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
PS C:\>Get-AzApiManagementUser -Context $apimContext -UserId "0123456789"
```

This command gets a user by ID.

### Example: Get users by last name
```
### Example 3: Get users by last name
```powershell
PS C:\>$apimContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
PS C:\>Get-AzApiManagementUser -Context $apimContext -LastName "Fuller"
```

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

### Example 4: Get a user by email address
```
```powershell
PS C:\>$apimContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
PS C:\>Get-AzApiManagementUser -Context $apimContext -Email "[email protected]"
```

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

### Example 5: Get all users within a group
```
```powershell
PS C:\>$apimContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
PS C:\>Get-AzApiManagementUser -Context $apimContext -GroupId "0001"
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ The **Import-AzApiManagementApi** cmdlet imports an Azure API Management API fro

## EXAMPLES

### Example 1 Import an API from a WADL file
### Example 1: Import an API from a WADL file
```powershell
PS C:\>$ApiMgmtContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
PS C:\>Import-AzApiManagementApi -Context $ApiMgmtContext -SpecificationFormat "Wadl" -SpecificationPath "C:\contoso\specifications\echoapi.wadl" -Path "apis"
```

This command imports an API from the specified WADL file.

### Example 2 Import an API from a Swagger file
### Example 2: Import an API from a Swagger file
```powershell
PS C:\>$ApiMgmtContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
PS C:\>Import-AzApiManagementApi -Context $ApiMgmtContext -SpecificationFormat "Swagger" -SpecificationPath "C:\contoso\specifications\echoapi.swagger" -Path "apis"
Expand Down
10 changes: 9 additions & 1 deletion src/ApiManagement/ApiManagement/help/New-AzApiManagementApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ PS C:\>New-AzApiManagementApi -Context $ApiMgmtContext -Name "Echo api" -Service

This command creates an API named EchoApi with the specified URL.

### Example 1: Create an API by copying all operation, Tags, Products and Policies from echo-api and into an ApiVersionSet
### Example 2: Create an API by copying all operation, Tags, Products and Policies from echo-api and into an ApiVersionSet
```powershell
PS D:\github\azure-powershell>$context = New-AzApiManagementContext -ResourceId /subscriptions/subid/resourceGroups/Api-Default-West-US/providers/Microsoft.ApiManagement/service/contoso
PS D:\github\azure-powershell>$versionSet = Get-AzApiManagementApiVersionSet -Context $context -ApiVersionSetId "xmsVersionSet"
Expand Down Expand Up @@ -71,6 +71,14 @@ ServiceName : contoso

This command creates an API `echoapiv3` in ApiVersionSet `xmsVersionSet` and copies all operation, Tags and Policies from source Api `echo-api`. It overrides the SubscriptionRequired, ServiceUrl, Path, Protocols

### Example 3

Creates an API. (autogenerated)

```powershell <!-- Aladdin Generated Example -->
New-AzApiManagementApi -ApiId '0001' -Context <PsApiManagementContext> -Name 'Echo api' -Path 'echov3' -Protocols Http -ServiceUrl 'https://contoso.com/apis/echo'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing I question about this example is the Http protocol is specified, but an HTTPS URL is provided. I would think the protocol would need to match the type URL for the example to be valid. Preferably, the Protocol would be Https in this example.

```

## PARAMETERS

### -ApiId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Creates the new API Schema of the API.

## EXAMPLES

### Example 1 : Create new Schema for Swagger Petstore Extensive API
### Example 1: Create new Schema for Swagger Petstore Extensive API
```powershell
PS D:\github\azure-powershell> $context = New-AzApiManagementContext -ResourceId /subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.ApiManagement/service/sdktestapim4163
PS D:\github\azure-powershell> New-AzApiManagementApiSchema -Context $context -ApiId swagger-petstore-extensive -SchemaDocumentContentType swaggerdefinition -SchemaDocumentFilePath C:\Users\sasolank\Downloads\petstoreschema.json
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ PS C:\>New-AzApiManagementAuthorizationServer -Context $ApiMgmtContext -Name "Co

This command creates an authorization server.

### Example 2

Creates an authorization server. (autogenerated)

```powershell <!-- Aladdin Generated Example -->
New-AzApiManagementAuthorizationServer -AccessTokenSendingMethods AuthorizationHeader -AuthorizationEndpointUrl 'https://contoso/auth' -AuthorizationRequestMethods Get -ClientAuthenticationMethods Basic -ClientId 'clientid' -ClientRegistrationPageUrl 'https://contoso/signup' -ClientSecret '0000000000000000000000000000000000000' -Context <PsApiManagementContext> -GrantTypes AuthorizationCode -Name 'Contoso OAuth2 server' -ServerId '0123456789' -TokenBodyParameters @{'par1'='val1'} -TokenEndpointUrl 'https://contoso/token'
```

## PARAMETERS

### -AccessTokenSendingMethods
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Creates a new backend entity in Api Management.

## EXAMPLES

### Create Backend 123 with a Basic Authorization Scheme
### Example 1: Create Backend 123 with a Basic Authorization Scheme
```powershell
PS C:\>$apimContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
PS C:\>$credential = New-AzApiManagementBackendCredential -AuthorizationHeaderScheme basic -AuthorizationHeaderParameter opensesame -Query @{"sv" = @('xx', 'bb'); "sr" = @('cc')} -Header @{"x-my-1" = @('val1', 'val2')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Creates a new Backend Credential contract.

## EXAMPLES

### Create a Backend Credentials In-Memory Object
### Example 1: Create a Backend Credentials In-Memory Object
```powershell
PS C:\>$apimContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
PS C:\>$credential = New-AzApiManagementBackendCredential -AuthorizationHeaderScheme basic -AuthorizationHeaderParameter opensesame -Query @{"sv" = @('xx', 'bb'); "sr" = @('cc')} -Header @{"x-my-1" = @('val1', 'val2')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Creates a new Backend Proxy Object which can be piped when creating a new Backen

## EXAMPLES

### Create a Backend Proxy In-Memory Object
### Example 1: Create a Backend Proxy In-Memory Object
```powershell
PS C:\>$secpassword = ConvertTo-SecureString "PlainTextPassword" -AsPlainText -Force
PS C:\>$proxyCreds = New-Object System.Management.Automation.PSCredential ("foo", $secpassword)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ PS C:\>New-AzApiManagementCertificate -Context $ApiMgmtContext -PfxFilePath "C:\

This command uploads a certificate to Api Management. This certificate can be used for mutual authentication with backend using policies.

### Example 2

Creates an API Management certificate to be used during Authentication with Backend. (autogenerated)

```powershell <!-- Aladdin Generated Example -->
New-AzApiManagementCertificate -CertificateId '0123456789' -Context <PsApiManagementContext> -PfxFilePath 'C:\contoso\certificates\apimanagement.pfx' -PfxPassword '1111'
```

## PARAMETERS

### -CertificateId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ The cmdlet **New-AzApiManagementDiagnostic** creates a diagnostic entity either

## EXAMPLES

### Example 1 : Create a new Global scope Diagnostic
### Example 1: Create a new Global scope Diagnostic
```powershell
PS D:\github\azure-powershell> $context = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
PS D:\github\azure-powershell> $logger = Get-AzApiManagementLogger -Context $context -LoggerId "backendapisachinc"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,21 @@ The **New-AzApiManagementGroup** cmdlet creates an API management group.
## EXAMPLES

### Example 1: Create a management group
```
```powershell
PS C:\>$apimContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
PS C:\>New-AzApiManagementGroup -Context $apimContext -Name "Group0001"
```

This command creates a management group.

### Example 2

Creates an API management group. (autogenerated)

```powershell <!-- Aladdin Generated Example -->
New-AzApiManagementGroup -Context <PsApiManagementContext> -Description 'Create Echo Api V4' -GroupId '0001' -Name 'Group0001' -Type Custom
```

## PARAMETERS

### -Context
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The cmdlet **New-AzApiManagementHttpMessageDiagnostic** creates the Http Message

## EXAMPLES

### Example 1 : Create a Basic Http Message diagnostic Setting
### Example 1: Create a Basic Http Message diagnostic Setting
```powershell
PS C:\> New-AzApiManagementHttpMessageDiagnostic -Headers 'Content-Type', 'UserAgent' -BodyBytes 100
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ PS C:\>New-AzApiManagementLogger -Context $apimContext -LoggerId "Logger123" -Na

This command creates a logger named ContosoSdkEventHub by using the specified connection string.

### Example 2

Creates an API Management Logger. (autogenerated)

```powershell <!-- Aladdin Generated Example -->
New-AzApiManagementLogger -Context <PsApiManagementContext> -InstrumentationKey <String> -LoggerId 'Logger123'
```

## PARAMETERS

### -ConnectionString
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,21 @@ The **New-AzApiManagementOpenIdConnectProvider** cmdlet creates an OpenID Connec
## EXAMPLES

### Example 1: Create a provider
```
```powershell
PS C:\>$apimContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
PS C:\>New-AzApiManagementOpenIdConnectProvider -Context $apimContext -OpenIdConnectProviderId "OICProvider01" -Name "Contoso OpenID Connect Provider" -MetadataEndpointUri "https://openid.provider/configuration" -ClientId "12432143" -Description "OpenID Connect provider description"
```

This command creates an OpenID Connect **Provider** named Contoso OpenID Connect Provider

### Example 2

Creates an OpenID Connect provider. (autogenerated)

```powershell <!-- Aladdin Generated Example -->
New-AzApiManagementOpenIdConnectProvider -ClientId '12432143' -ClientSecret '000000000000000000000000000000000000000000' -Context <PsApiManagementContext> -Description 'OpenID Connect provider description' -MetadataEndpointUri 'https://openid.provider/configuration' -Name 'Contoso OpenID Connect Provider' -OpenIdConnectProviderId 'OICProvider01'
```

## PARAMETERS

### -ClientId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The cmdlet **New-AzApiManagementSamplingSetting** creates a new sampling setting

## EXAMPLES

### Example 1 : Create a basic Sampling setting
### Example 1: Create a basic Sampling setting
```powershell
PS C:\> New-AzApiManagementSamplingSetting -SamplingType fixed -Percentage 100

Expand All @@ -33,6 +33,14 @@ fixed 100

Creates a sampling setting of `Fixed` type with logging for 100% of the requests / responses

### Example 2

Create a new sampling setting for the Diagnostic. (autogenerated)

```powershell <!-- Aladdin Generated Example -->
New-AzApiManagementSamplingSetting -SamplingPercentage 100 -SamplingType fixed
```

## PARAMETERS

### -DefaultProfile
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ This command is to be used with New-AzApiManagement command.

## EXAMPLES

### Example 1 : Create an SSL Setting to enable TLS 1.0 on both Backend and Frontend
### Example 1: Create an SSL Setting to enable TLS 1.0 on both Backend and Frontend
```powershell
PS D:\github\azure-powershell\artifacts\Debug\Az.ApiManagement> $enableTls=@{"Tls10" = "True"}
PS D:\github\azure-powershell\artifacts\Debug\Az.ApiManagement> New-AzApiManagementSslSetting -FrontendProtocol $enableTls -BackendProtocol $enableTls
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The cmdlet **New-AzApiManagementUserToken** generates a Shared Access Token for

## EXAMPLES

### Example 1 : Generate a Shared Access Token for Git User
### Example 1: Generate a Shared Access Token for Git User
```powershell
PS D:\github\azure-powershell> $context = New-AzApiManagementContext -ResourceGroupName powershelltest -ServiceName
powershellsdkservice
Expand All @@ -37,6 +37,14 @@ integration 5/3/2019 2:02:34 PM Primary integration&201905031402&zOwopJChWAA6oaq

This script get the Git user configured in ApiManagement service and generates a Shared Access Token using the Primary Key valid for 8 hours.

### Example 2

Generates a Shared Access Token for the User. (autogenerated)

```powershell <!-- Aladdin Generated Example -->
New-AzApiManagementUserToken -Context <PsApiManagementContext> -Expiry <DateTime> -UserId <String>
```

## PARAMETERS

### -Context
Expand Down
Loading