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
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
4 changes: 2 additions & 2 deletions src/Compute/Compute/help/New-AzDiskEncryptionSet.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ 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:\> $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:\> $config | New-AzDiskEncryptionSet -ResourceGroupName 'rg1' -Name 'enc1'
```

Creates disk encryption set using the given active key in the key vault.
Expand Down
4 changes: 2 additions & 2 deletions src/Compute/Compute/help/New-AzDiskEncryptionSetConfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ Creates a configurable disk encryption set object.

### 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:\> $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:\> $config | New-AzDiskEncryptionSet -ResourceGroupName 'rg1' -Name 'enc1'
```

Creates disk encryption set using the given active key in the key vault.
Expand Down
9 changes: 9 additions & 0 deletions src/Compute/Compute/help/New-AzVmssConfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,15 @@ Creates a VMSS configuration object. (autogenerated)
New-AzVmssConfig -Location <String> -Overprovision $false -SkuCapacity 2 -SkuName 'Standard_A0' -Tag 'Sql' -UpgradePolicyMode Automatic
```

### Example 3

Creates a VMSS configuration object. (autogenerated)

<!-- Aladdin Generated Example -->
```powershell
New-AzVmssConfig -Location <String> -SkuCapacity 2 -SkuName 'Standard_A0' -UpgradePolicyMode Automatic -IdentityType SystemAssigned
```

## PARAMETERS

### -AutomaticRepairGracePeriod
Expand Down
11 changes: 10 additions & 1 deletion src/Compute/Compute/help/Save-AzVMImage.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ You can deploy virtual machines from your captured image.
## EXAMPLES

### Example 1: Capture a virtual machine
```
```powershell
PS C:\> Set-AzVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMachine07" -Generalized
PS C:\> Save-AzVMImage -ResourceGroupName "ResourceGroup11" -VMName "VirtualMachine07" -DestinationContainerName "VMContainer01" -VHDNamePrefix "VM07"
```
Expand All @@ -44,6 +44,15 @@ The first command marks the virtual machine named VirtualMachine07 as generalize
The second command captures a virtual machine named VirtualMachine07 as a VMImage.
The **Output** property returns a JSON template.

### Example 2

Saves a virtual machine as a VMImage. (autogenerated)

<!-- Aladdin Generated Example -->
```powershell
Save-AzVMImage -DestinationContainerName 'VMContainer01' -Name 'VirtualMachine07' -Path '/home/admin/.ssh/authorized_keys' -ResourceGroupName 'ResourceGroup11' -VHDNamePrefix 'VM07'
```

## PARAMETERS

### -AsJob
Expand Down
12 changes: 11 additions & 1 deletion src/Compute/Compute/help/Set-AzVmssVM.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,20 @@ The **Set-AzVmssVM** cmdlet modifies the state of a Virtual Machine Scale Set (V

Modifies the state of a VMSS instance. (autogenerated)

```powershell <!-- Aladdin Generated Example -->
<!-- Aladdin Generated Example -->
```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.

Set-AzVmssVM -InstanceId <String> -Reimage -ResourceGroupName myresourcegroup -VMScaleSetName 'VMSS001'
```

### Example 2

Modifies the state of a VMSS instance. (autogenerated)

<!-- Aladdin Generated Example -->
```powershell
Set-AzVmssVM -InstanceId <String> -PerformMaintenance -ResourceGroupName myresourcegroup -VMScaleSetName 'VMSS001'
```

## PARAMETERS

### -AsJob
Expand Down
11 changes: 10 additions & 1 deletion src/Compute/Compute/help/Update-AzVmss.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,21 @@ The **Update-AzVmss** cmdlet updates the state of a Virtual Machine Scale Set (V
## EXAMPLES

### Example 1: Update the state of a VMSS to the state of a local VMSS object.
```
```powershell
PS C:\> Update-AzVmss -ResourceGroupName "Group001" -Name "VMSS001" -VirtualMachineScaleSet $LocalVMSS
```

This command updates the state of the VMSS named VMSS001 that belongs to the resource group named Group001 to the state of a local VMSS object, $LocalVMSS.

### Example 2

Updates the state of a VMSS. (autogenerated)

<!-- Aladdin Generated Example -->
```powershell
Update-AzVmss -ResourceGroupName 'Group001' -VMScaleSetName 'VMSS001' -VirtualMachineScaleSet <PSVirtualMachineScaleSet> -IdentityType SystemAssigned
```

## PARAMETERS

### -AsJob
Expand Down
11 changes: 10 additions & 1 deletion src/Monitor/Monitor/help/Add-AzAutoscaleSetting.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

PS C:\>$Rule1 = New-AzAutoscaleRule -MetricName "Requests" -MetricResourceId "/subscriptions/b93fb07a-6f93-30be-bf3e-4f0deca15f4f/resourceGroups/Default-Web-EastUS/providers/microsoft.web/sites/mywebsite" -Operator GreaterThan -MetricStatistic Average -Threshold 10 -TimeGrain 00:01:00 -ScaleActionCooldown 00:05:00 -ScaleActionDirection Increase -ScaleActionScaleType ChangeCount -ScaleActionValue "1"

PS C:\> $Rule2 = New-AzAutoscaleRule -MetricName "Requests" -MetricResourceId "/subscriptions/b93fb07a-6f93-30be-bf3e-4f0deca15f4f/resourceGroups/Default-Web-EastUS/providers/microsoft.web/sites/mywebsite" -Operator GreaterThan -MetricStatistic Average -Threshold 10 -TimeGrain 00:01:00 -ScaleActionCooldown 00:10:00 -ScaleActionDirection Increase -ScaleActionScaleType ChangeCount -ScaleActionValue "2"
Expand All @@ -53,6 +53,15 @@ The first two commands use [New-AzAutoscaleRule](https://docs.microsoft.com/powe
The third and fourth commands use [New-AzAutoscaleProfile](https://docs.microsoft.com/powershell/module/az.monitor/new-azautoscaleprofile) to create Autoscale profiles, $Profile1 and $Profile2, using $Rule1 and $Rule2.
The final command creates an Autoscale setting using the profiles in $Profile1 and $Profile2.

### Example 2

Creates an Autoscale setting. (autogenerated)

<!-- Aladdin Generated Example -->
```powershell
Add-AzAutoscaleSetting -AutoscaleProfile <List`1[AutoscaleProfile]> -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'
```

## PARAMETERS

### -AutoscaleProfile
Expand Down
64 changes: 4 additions & 60 deletions src/Monitor/Monitor/help/New-AzDataCollectionRule.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ The output of a DCR serialized with the cmdlet ConvertTo-Json is also supported

### Example 1: Create data collection rule, JSON from Rest API
```powershell
PS C:\>New-AzDataCollectionRule -Location 'East US 2 EUAP' -ResourceGroupName 'testdcr'
-RuleName 'newDcrEx1' -RuleFile 'C:\samples\dcrEx1.json'
-Description 'Dcr description'
PS C:\>New-AzDataCollectionRule -Location 'East US 2 EUAP' -ResourceGroupName 'testdcr' `
-RuleName 'newDcrEx1' -RuleFile 'C:\samples\dcrEx1.json' `
-Description 'Dcr description' `
-Tag @{"tag1"="value1"; "tag2"="value2"}

Description : Dcr description
Expand Down Expand Up @@ -98,62 +98,6 @@ Tags : {[tag2, value2], [tag1, value1]}

This command creates a data collection rules for the current subscription.

### Example 2: Create data collection rule, JSON from PSDataCollectionRuleResource
```powershell
PS C:\>New-AzDataCollectionRule -Location 'East US 2 EUAP' -ResourceGroupName 'testdcr'
-RuleName 'newDcrEx2' -RuleFile 'C:\samples\dcrEx2.json'
-Description 'Dcr description'
-Tag @{"tag1"="value1"; "tag2"="value2"}

Description : Dcr description
DataSources : Microsoft.Azure.Commands.Insights.OutputClasses.PSDataCollectionRuleDataSources
Destinations : Microsoft.Azure.Commands.Insights.OutputClasses.PSDataCollectionRuleDestinations
DataFlows : {Microsoft.Azure.Commands.Insights.OutputClasses.PSDataFlow}
ProvisioningState : Succeeded
Etag : "{etag}"
Id : /subscriptions/{subId}/resourceGroups/testdcr/providers/Microsoft.Insights/dataCollectionRules/newDcrEx2
Name : newDcrEx2
Type : Microsoft.Insights/dataCollectionRules
Location : East US 2 EUAP
Tags : {[tag2, value2], [tag1, value1]}

# Note: Content of C:\samples\dcrEx2.json
{
"DataSources": {
"PerformanceCounters": [
{
"Streams": [
"Microsoft-InsightsMetrics"
],
"ScheduledTransferPeriod": "PT1M",
"SamplingFrequencyInSeconds": 10,
"CounterSpecifiers": [
"\\Processor Information(_Total)\\% Processor Time"
],
"Name": "perfCounter01"
}
]
},
"Destinations": {
"AzureMonitorMetrics": {
"Name": "azureMonitorMetrics-default"
}
},
"DataFlows": [
{
"Streams": [
"Microsoft-InsightsMetrics"
],
"Destinations": [
"azureMonitorMetrics-default"
]
}
]
}
```

This command creates a data collection rules for the current subscription.

## PARAMETERS

### -DefaultProfile
Expand Down Expand Up @@ -309,4 +253,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
[Set-AzDataCollectionRule](./Set-AzDataCollectionRule.md)
[Remove-AzDataCollectionRule](./Remove-AzDataCollectionRule.md)
[Get-AzDataCollectionRule](./Get-AzDataCollectionRule.md)
[Update-AzDataCollectionRule](./Update-AzDataCollectionRule.md)
[Update-AzDataCollectionRule](./Update-AzDataCollectionRule.md)
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,14 @@ The **Add-AzApplicationGatewayTrustedClientCertificate** cmdlet adds a trusted c
## EXAMPLES

### Example 1

Adds a trusted client CA certificate chain to an application gateway. (autogenerated)

<!-- Aladdin Generated Example -->
```powershell
PS C:\> $gw = Get-AzApplicationGateway -Name $appgwName -ResourceGroupName $resgpName
PS C:\> $trustedClient = New-AzApplicationGatewayTrustedClientCertificate -Name "ClientCert" -CertificateFile "C:\clientCAChain.cer"
PS C:\> $AppGw = Add-AzApplicationGatewaySslProfile -Name $sslProfileName -ApplicationGateway $gw -TrustedClientCertificates $trustedClient
PS C:\> $gw = Set-AzApplicationGateway -ApplicationGateway $gw
Add-AzApplicationGatewayTrustedClientCertificate -ApplicationGateway <PSApplicationGateway> -CertificateFile 'C:\cert.cer' -Name 'cert01'
```

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.

## PARAMETERS

### -ApplicationGateway
Expand Down Expand Up @@ -146,4 +145,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

[Remove-AzApplicationGatewayTrustedClientCertificate](./Remove-AzApplicationGatewayTrustedClientCertificate.md)

[Set-AzApplicationGatewayTrustedClientCertificate](./Set-AzApplicationGatewayTrustedClientCertificate.md)
[Set-AzApplicationGatewayTrustedClientCertificate](./Set-AzApplicationGatewayTrustedClientCertificate.md)
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ cmdlet to activate the configuration.
## EXAMPLES

### Example 1: Add a peer to an existing ExpressRoute circuit
```
```powershell
$circuit = Get-AzExpressRouteCircuit -Name $CircuitName -ResourceGroupName $rg
$parameters = @{
Name = 'AzurePrivatePeering'
Expand All @@ -68,6 +68,15 @@ Add-AzExpressRouteCircuitPeeringConfig @parameters
Set-AzExpressRouteCircuit -ExpressRouteCircuit $circuit
```

### Example 2

Adds a peering configuration to an ExpressRoute circuit. (autogenerated)

<!-- Aladdin Generated Example -->
```powershell
Add-AzExpressRouteCircuitPeeringConfig -ExpressRouteCircuit <PSExpressRouteCircuit> -MicrosoftConfigAdvertisedPublicPrefixes <String[]> -MicrosoftConfigCustomerAsn <Int32> -MicrosoftConfigRoutingRegistryName <String> -Name 'AzurePrivatePeering' -PeerASN 100 -PeerAddressType IPv4 -PeeringType AzurePrivatePeering -PrimaryPeerAddressPrefix '123.0.0.0/30' -SecondaryPeerAddressPrefix '123.0.0.4/30' -VlanId 300
```

## PARAMETERS

### -DefaultProfile
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@ PS C:\> $slb | Add-AzLoadBalancerInboundNatPoolConfig -Name "myInboundNatPool" -
PS C:\> $lb | Set-AzLoadBalancer
```

### Example 2

Adds an inbound NAT pool to a load balancer. (autogenerated)

<!-- Aladdin Generated Example -->
```powershell
Add-AzLoadBalancerInboundNatPoolConfig -BackendPort 1001 -FrontendIpConfigurationId <String> -FrontendPortRangeEnd 2000 -FrontendPortRangeStart 1001 -Name 'myInboundNatPool' -Protocol TCP -LoadBalancer <PSLoadBalancer>
```

## PARAMETERS

### -BackendPort
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ The **Add-AzLoadBalancerInboundNatRuleConfig** cmdlet adds an inbound network ad
## EXAMPLES

### Example 1: Add an inbound NAT rule configuration to a load balancer
```
```powershell
PS C:\>$slb = Get-AzLoadBalancer -Name "MyLoadBalancer" -ResourceGroupName "MyResourceGroup"
PS C:\> $slb | Add-AzLoadBalancerInboundNatRuleConfig -Name "NewNatRule" -FrontendIPConfiguration $slb.FrontendIpConfigurations[0] -Protocol "Tcp" -FrontendPort 3350 -BackendPort 3350 -EnableFloatingIP
PS C:\> $slb | Set-AzLoadBalancer
Expand Down
18 changes: 9 additions & 9 deletions src/Network/Network/help/Add-AzNetworkSecurityRuleConfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,25 +38,25 @@ The **Add-AzNetworkSecurityRuleConfig** cmdlet adds a network security rule conf

## EXAMPLES

### 1: Adding a network security group
```
### Example 1: Adding a network security group
```powershell
Get-AzNetworkSecurityGroup -Name nsg1 -ResourceGroupName rg1 |
Add-AzNetworkSecurityRuleConfig -Name rdp-rule -Description "Allow RDP" -Access
Allow -Protocol Tcp -Direction Inbound -Priority 100 -SourceAddressPrefix Internet
-SourcePortRange * -DestinationAddressPrefix * -DestinationPortRange 3389 |
Add-AzNetworkSecurityRuleConfig -Name rdp-rule -Description "Allow RDP" -Access `
Allow -Protocol Tcp -Direction Inbound -Priority 100 -SourceAddressPrefix Internet `
-SourcePortRange * -DestinationAddressPrefix * -DestinationPortRange 3389 |
Set-AzNetworkSecurityGroup
```

The first command retrieves an Azure network security group named "nsg1" from resource group "rg1". The second command adds a network security rule named "rdp-rule" that allows traffic from internet on port 3389 to the retrieved network security group object. Persists the modified Azure network security group.

### 2: Adding a new security rule with application security groups
```
### Example 2: Adding a new security rule with application security groups
```powershell
$srcAsg = New-AzApplicationSecurityGroup -ResourceGroupName MyResourceGroup -Name srcAsg -Location "West US"
$destAsg = New-AzApplicationSecurityGroup -ResourceGroupName MyResourceGroup -Name destAsg -Location "West US"

Get-AzNetworkSecurityGroup -Name nsg1 -ResourceGroupName rg1 |
Add-AzNetworkSecurityRuleConfig -Name rdp-rule -Description "Allow RDP" -Access
Allow -Protocol Tcp -Direction Inbound -Priority 100 -SourceApplicationSecurityGroup
Add-AzNetworkSecurityRuleConfig -Name rdp-rule -Description "Allow RDP" -Access `
Allow -Protocol Tcp -Direction Inbound -Priority 100 -SourceApplicationSecurityGroup `
$srcAsg -SourcePortRange * -DestinationApplicationSecurityGroup $destAsg -DestinationPortRange 3389 |
Set-AzNetworkSecurityGroup
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ The **Disconnect-AzVirtualNetworkGatewayVpnConnection** cmdlet enables you to di

## EXAMPLES

### Example
```
### Example 1
```powershell
PS C:\> Disconnect-AzVirtualNetworkGatewayVpnConnection -ResourceName vnet-gw -ResourceGroupName vnetgwrg -VpnConnectionId @("IKEv2_7e1cfe59-5c7c-4315-a876-b11fbfdfeed4")

```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The **Get-AzAvailableServiceDelegation** cmdlet allows you to retrieve all of th

## EXAMPLES

### 1: Getting all available service delegations
### Example 1: Getting all available service delegations
```powershell
PS C:\> Get-AzAvailableServiceDelegation -Location "westus"

Expand Down
4 changes: 2 additions & 2 deletions src/Network/Network/help/Get-AzCustomIpPrefix.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ The **Get-AzCustomIpPrefix** cmdlet gets one or more CustomIpPrefixes given the

### Example 1
```powershell
PS C:\> Get-AzPublicIpPrefix -ResourceGroupName myRg -Name myCustomIpPrefix
PS C:\> Get-AzCustomIpPrefix -ResourceGroupName myRg -Name myCustomIpPrefix

Name : myCustomIpPrefix
ResourceGroupName : myRg
Expand Down Expand Up @@ -130,4 +130,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

[Remove-AzCustomIpPrefix](./Remove-AzCustomIpPrefix.md)

[Update-AzCustomIpPrefix](./Update-AzCustomIpPrefix.md)
[Update-AzCustomIpPrefix](./Update-AzCustomIpPrefix.md)
Loading