Skip to content

Aladdin generated examples for Compute, Monitor, Network, Resources, Sql, Websites #15567

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 4 commits into from
Sep 27, 2021

Conversation

aladdindoc
Copy link
Contributor

  • Add Aladdin crafted examples.

	- Add new examples to the following modules:
		Compute
		Monitor
		Network
		Resources
		Sql
		Websites
@ghost
Copy link

ghost commented Jul 28, 2021

Thank you for your contribution aladdindoc! We will review the pull request and get back to you soon.

@isra-fel
Copy link
Member

Hi Mike would you be able to review this? Thanks

@kceiw kceiw requested a review from dcaro July 28, 2021 16:02
@@ -56,6 +56,15 @@ Modifies the state of a VMSS instance. (autogenerated)

```powershell <!-- Aladdin Generated Example -->
Set-AzVmssVM -InstanceId <String> -Reimage -ResourceGroupName myresourcegroup -VMScaleSetName 'VMSS001'
```powershell
Copy link
Contributor

Choose a reason for hiding this comment

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

Line 59 appears to be the ending code fence. Closing code blocks should not include a language type.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'll take a look why the language type was added.

@@ -37,7 +37,7 @@ This cmdlet implements the ShouldProcess pattern, i.e. it might request confirma
## EXAMPLES

### Example 1: Create an Autoscale setting
```
```powershell
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see a closing code fence for example 1.

Copy link
Contributor

Choose a reason for hiding this comment

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

That's at the line 50.

@@ -32,6 +32,15 @@ PS C:\> $gw = Set-AzApplicationGateway -ApplicationGateway $gw

The first command gets the application gateway and stores it in $gw variable. The second command creates a new trusted client CA certificate chain taking path of the client CA certificate as input. The third command creates a SSL profile using trusted client certificate. The fourth command updates the Application Gateway.

### Example 2

The first command gets the application gateway and stores it in $gw variable. The second command creates a new trusted client CA certificate chain taking path of the client CA certificate as input. The third command creates a SSL profile using trusted client certificate. The fourth command updates the Application Gateway. (autogenerated)
Copy link
Contributor

Choose a reason for hiding this comment

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

This text appears to be duplicated from the previous paragraph and doesn't match up with what's occurring in the example.


<!-- Aladdin Generated Example -->
```powershell
Get-AzVirtualNetworkGatewayVpnClientConnectionHealth -ResourceGroupName resourceGroup -VirtualNetworkGatewayName 'ContosoVirtualNetwork' -ResourceName 'ContosoVirtualNetwork' -InputObject <PSVirtualNetworkGateway> -ResourceId <String>
Copy link
Contributor

Choose a reason for hiding this comment

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

The parameters VirtualNetworkGatewayName, InputObject, and ResourceId are in mutually exclusive parameter sets and can't be used together.

Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a way to check that they are mutually exclusive? In the documentation, there is only one parameter set and all those three parameters are optional.

Copy link
Contributor

Choose a reason for hiding this comment

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

The parameter set documentation appears to be inaccurate for the Get-AzVirtualNetworkGatewayVpnClientConnectionHealth cmdlet. Get-Command -Name Get-AzVirtualNetworkGatewayVpnClientConnectionHealth -Syntax is the command I used to determine the parameter sets.

@@ -25,7 +25,7 @@ Creates a disk encryption set.
### Example 1
```powershell
PS C:\> $config = New-AzDiskEncryptionSetConfig -Location 'westcentralus' -KeyUrl "https://valut1.vault.azure.net:443/keys/key1/mykey" -SourceVaultId '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.KeyVault/vaults/vault1 -IdentityType 'SystemAssigned'
PS C:\> New-AzDiskEncryptionSet -ResourceGroupName 'rg1' -Name 'enc1' -DiskEncryptionSet $config;
PS C:\> New-AzDiskEncryptionSet -ResourceGroupName 'rg1' -Name 'enc1' -DiskEncryptionSet $config
Copy link
Contributor

Choose a reason for hiding this comment

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

There isn't a DiskEncryptionSet parameter. DiskEncryptionSet is a parameter alias for the InputObject parameter.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is an existing example. Aladdin doesn't add it.
I can convert it to $config | New-AzDiskEncryptionSet ...


<!-- Aladdin Generated Example -->
```powershell
Add-AzAutoscaleSetting -AutoscaleProfile <List`1> -DisableSetting -Location 'East US' -Name 'MySetting' -ResourceGroupName 'Default-Web-EastUS' -TargetResourceId '/subscriptions/00000000-0000-0000-0000-00000000000000000/resourceGroups/Default-Web-EastUS/providers/microsoft.web/serverFarms/DefaultServerFarm'
Copy link
Contributor

Choose a reason for hiding this comment

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

The value for the AutoscaleProfile parameter should be <List[AutoscaleProfile]>.

Comment on lines 103 to 105
PS C:\>New-AzDataCollectionRule -Location 'East US 2 EUAP' -ResourceGroupName 'testdcr' `
-RuleName 'newDcrEx2' -RuleFile 'C:\samples\dcrEx2.json' `
-Description 'Dcr description' `
Copy link
Contributor

Choose a reason for hiding this comment

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

How does this example differ from example 1?

Copy link
Contributor

Choose a reason for hiding this comment

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

No. And this is not added by Aladdin. I can remove it manually.
The change here is to append '`' at the end to make the commands in both example properly multiline commands.


<!-- Aladdin Generated Example -->
```powershell
Disconnect-AzVirtualNetworkGatewayVpnConnection -ResourceGroupName vnetgwrg -VirtualNetworkGatewayName 'ContosoVirtualNetwork' -VpnConnectionId @('IKEv2_00000000-0000-0000-0000-00000000000000000') -InputObject <PSVirtualNetworkGateway>
Copy link
Contributor

Choose a reason for hiding this comment

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

The parameters ResourceGroupName and VirtualNetworkGatewayName are in a different parameter set than VpnConnectionId and InputObject and can't be used together because they're mutually exclusive.


<!-- Aladdin Generated Example -->
```powershell
New-AzExpressRouteGateway -MaxScaleUnits <UInt32> -MinScaleUnits 2 -Name 'testExpressRoutegw' -ResourceGroupName 'testRG' -Tag '/Sql' -VirtualHubName <String>
Copy link
Contributor

Choose a reason for hiding this comment

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

The Tag parameter requires a hashtable for its value. The specified value is not a valid hashtable.


<!-- Aladdin Generated Example -->
```powershell
Set-AzApplicationGatewayAutoscaleConfiguration -ApplicationGateway <PSApplicationGateway> -MaxCapacity 4 -MinCapacity 5
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't seem valid. How can the minimum capacity be more than the maximum capacity?


<!-- Aladdin Generated Example -->
```powershell
Add-AzLoadBalancerInboundNatRuleConfig -BackendPort 3350 -FrontendIpConfiguration <PSFrontendIPConfiguration> -FrontendPort 3350 -Name 'NewNatRule' -Protocol 'TCP' -LoadBalancer <PSLoadBalancer>
Copy link
Contributor

Choose a reason for hiding this comment

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

Will remove this example

Copy link
Contributor

@mikefrobbins mikefrobbins left a comment

Choose a reason for hiding this comment

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

LGTM

@dcaro dcaro merged commit 20e4a17 into Azure:main Sep 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants