Skip to content

Commit c95c7e7

Browse files
authored
Merge pull request #111324 from BethWilke/branch115
Fixing documentation task 1704284
2 parents 27b48b3 + 7d51cb7 commit c95c7e7

11 files changed

+173
-183
lines changed

articles/automation/automation-connections.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,5 +160,6 @@ azure_credential = get_automation_runas_credential(runas_connection)
160160
## Next steps
161161

162162
- Review [Links in graphical authoring](automation-graphical-authoring-intro.md#links-and-workflow) to understand how to direct and control the flow of logic in your runbooks.
163-
163+
* For a PowerShell cmdlet reference, see [Az.Automation](https://docs.microsoft.com/powershell/module/az.automation/?view=azps-3.7.0#automation
164+
).
164165
- To learn more about Azure Automation's use of PowerShell modules and best practices for creating your own PowerShell modules to work as Integration Modules within Azure Automation, see [Integration Modules](automation-integration-modules.md).

articles/automation/automation-create-alert-triggered-runbook.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,3 +192,5 @@ Alerts use action groups, which are collections of actions that are triggered by
192192
* For details about different ways to start a runbook, see [Starting a runbook](automation-starting-a-runbook.md).
193193
* To learn how to create an activity log alert, see [Create activity log alerts](../azure-monitor/platform/activity-log-alerts.md?toc=%2fazure%2fautomation%2ftoc.json).
194194
* To learn how to create a near real-time alert, see [Create an alert rule in the Azure portal](../azure-monitor/platform/alerts-metric.md?toc=/azure/azure-monitor/toc.json).
195+
* For a PowerShell cmdlet reference, see [Az.Automation](https://docs.microsoft.com/powershell/module/az.automation/?view=azps-3.7.0#automation
196+
).

articles/automation/automation-create-standalone-account.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,4 +100,5 @@ Classic Run As accounts are no longer created by default when you create an Azur
100100
* To get started with PowerShell runbooks, see [My first PowerShell runbook](automation-first-runbook-textual-powershell.md).
101101
* To get started with PowerShell workflow runbooks, see [My first PowerShell workflow runbook](automation-first-runbook-textual.md).
102102
* To get started with Python 2 runbooks, see [My first Python2 runbook](automation-first-runbook-textual-python2.md).
103-
103+
* For a PowerShell cmdlet reference, see [Az.Automation](https://docs.microsoft.com/powershell/module/az.automation/?view=azps-3.7.0#automation
104+
).

articles/automation/automation-deploy-template-runbook.md

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,17 @@ templates in a central, secure location such as Azure Storage.
2020
In this article, we create a PowerShell runbook that uses a Resource Manager template stored in
2121
[Azure Storage](../storage/common/storage-introduction.md) to deploy a new Azure Storage account.
2222

23+
>[!NOTE]
24+
>This article has been updated to use the new Azure PowerShell Az module. You can still use the AzureRM module, which will continue to receive bug fixes until at least December 2020. To learn more about the new Az module and AzureRM compatibility, see [Introducing the new Azure PowerShell Az module](https://docs.microsoft.com/powershell/azure/new-azureps-module-az?view=azps-3.5.0). For Az module installation instructions on your Hybrid Runbook Worker, see [Install the Azure PowerShell Module](https://docs.microsoft.com/powershell/azure/install-az-ps?view=azps-3.5.0). For your Automation account, you can update your modules to the latest version using [How to update Azure PowerShell modules in Azure Automation](automation-update-azure-modules.md).
25+
2326
## Prerequisites
2427

2528
To complete this tutorial, you need the following items:
2629

2730
* Azure subscription. If you don't have one yet, you can [activate your MSDN subscriber benefits](https://azure.microsoft.com/pricing/member-offers/msdn-benefits-details/) or [sign up for a free account](https://azure.microsoft.com/free/).
2831
* [Automation account](automation-sec-configure-azure-runas-account.md) to hold the runbook and authenticate to Azure resources. This account must have permission to start and stop the virtual machine.
2932
* [Azure Storage account](../storage/common/storage-create-storage-account.md) in which to store the Resource Manager template
30-
* Azure Powershell installed on a local machine. See [Install and configure Azure Powershell](https://docs.microsoft.com/powershell/azure/azurerm/install-azurerm-ps) for information about how to get Azure PowerShell.
33+
* Azure PowerShell installed on a local machine. See [Install the Azure PowerShell Module](https://docs.microsoft.com/powershell/azure/install-az-ps?view=azps-3.5.0) for information about how to get Azure PowerShell.
3134

3235
## Create the Resource Manager template
3336

@@ -87,23 +90,23 @@ In a text editor, copy the following text:
8790
}
8891
```
8992

90-
Save the file locally as `TemplateTest.json`.
93+
Save the file locally as **TemplateTest.json**.
9194

9295
## Save the Resource Manager template in Azure Storage
9396

94-
Now we use PowerShell to create an Azure Storage file share and upload the `TemplateTest.json` file.
97+
Now we use PowerShell to create an Azure Storage file share and upload the **TemplateTest.json** file.
9598
For instructions on how to create a file share and upload a file in the Azure portal, see
9699
[Get started with Azure File storage on Windows](../storage/files/storage-dotnet-how-to-use-files.md).
97100

98101
Launch PowerShell on your local machine, and run the following commands to create a file share
99102
and upload the Resource Manager template to that file share.
100103

101104
```powershell
102-
# Login to Azure
103-
Connect-AzureRmAccount
105+
# Log into Azure
106+
Connect-AzAccount
104107
105108
# Get the access key for your storage account
106-
$key = Get-AzureRmStorageAccountKey -ResourceGroupName 'MyAzureAccount' -Name 'MyStorageAccount'
109+
$key = Get-AzStorageAccountKey -ResourceGroupName 'MyAzureAccount' -Name 'MyStorageAccount'
107110
108111
# Create an Azure Storage context using the first access key
109112
$context = New-AzureStorageContext -StorageAccountName 'MyStorageAccount' -StorageAccountKey $key[0].value
@@ -119,7 +122,7 @@ Set-AzureStorageFileContent -ShareName $fileShare.Name -Context $context -Source
119122

120123
## Create the PowerShell runbook script
121124

122-
Now we create a PowerShell script that gets the `TemplateTest.json` file from Azure Storage
125+
Now we create a PowerShell script that gets the **TemplateTest.json** file from Azure Storage
123126
and deploys the template to create a new Azure Storage account.
124127

125128
In a text editor, paste the following text:
@@ -143,13 +146,11 @@ param (
143146
$StorageFileName
144147
)
145148
146-
147-
148149
# Authenticate to Azure if running from Azure Automation
149150
$ServicePrincipalConnection = Get-AutomationConnection -Name "AzureRunAsConnection"
150-
Connect-AzureRmAccount `
151+
Connect-AzAccount `
151152
-ServicePrincipal `
152-
-TenantId $ServicePrincipalConnection.TenantId `
153+
-Tenant $ServicePrincipalConnection.TenantId `
153154
-ApplicationId $ServicePrincipalConnection.ApplicationId `
154155
-CertificateThumbprint $ServicePrincipalConnection.CertificateThumbprint | Write-Verbose
155156
@@ -166,10 +167,10 @@ Get-AzureStorageFileContent -ShareName 'resource-templates' -Context $Context -p
166167
$TemplateFile = Join-Path -Path 'C:\Temp' -ChildPath $StorageFileName
167168
168169
# Deploy the storage account
169-
New-AzureRmResourceGroupDeployment -ResourceGroupName $ResourceGroupName -TemplateFile $TemplateFile -TemplateParameterObject $Parameters
170+
New-AzResourceGroupDeployment -ResourceGroupName $ResourceGroupName -TemplateFile $TemplateFile -TemplateParameterObject $Parameters
170171
```
171172

172-
Save the file locally as `DeployTemplate.ps1`.
173+
Save the file locally as **DeployTemplate.ps1**.
173174

174175
## Import and publish the runbook into your Azure Automation account
175176

@@ -178,7 +179,7 @@ and then publish the runbook.
178179
For information about how to import and publish a runbook in the Azure portal, see
179180
[Manage runbooks in Azure Automation](manage-runbooks.md).
180181

181-
To import `DeployTemplate.ps1` into your Automation account as a PowerShell runbook,
182+
To import **DeployTemplate.ps1** into your Automation account as a PowerShell runbook,
182183
run the following PowerShell commands:
183184

184185
```powershell
@@ -191,24 +192,23 @@ $importParams = @{
191192
AutomationAccountName = 'MyAutomationAccount'
192193
Type = 'PowerShell'
193194
}
194-
Import-AzureRmAutomationRunbook @importParams
195+
Import-AzAutomationRunbook @importParams
195196
196197
# Publish the runbook
197198
$publishParams = @{
198199
ResourceGroupName = 'MyResourceGroup'
199200
AutomationAccountName = 'MyAutomationAccount'
200201
Name = 'DeployTemplate'
201202
}
202-
Publish-AzureRmAutomationRunbook @publishParams
203+
Publish-AzAutomationRunbook @publishParams
203204
```
204205

205206
## Start the runbook
206207

207208
Now we start the runbook by calling the
208-
[Start-AzureRmAutomationRunbook](https://docs.microsoft.com/powershell/module/azurerm.automation/start-azurermautomationrunbook)
209-
cmdlet.
210-
211-
For information about how to start a runbook in the Azure portal, see
209+
[Start-AzAutomationRunbook](https://docs.microsoft.com/powershell/module/Az.Automation/Start-AzAutomationRunbook?view=azps-3.7.0
210+
)
211+
cmdlet. For information about how to start a runbook in the Azure portal, see
212212
[Starting a runbook in Azure Automation](automation-starting-a-runbook.md).
213213

214214
Run the following commands in the PowerShell console:
@@ -222,7 +222,7 @@ $runbookParams = @{
222222
StorageFileName = 'TemplateTest.json'
223223
}
224224
225-
# Set up parameters for the Start-AzureRmAutomationRunbook cmdlet
225+
# Set up parameters for the Start-AzAutomationRunbook cmdlet
226226
$startParams = @{
227227
ResourceGroupName = 'MyResourceGroup'
228228
AutomationAccountName = 'MyAutomationAccount'
@@ -231,28 +231,28 @@ $startParams = @{
231231
}
232232
233233
# Start the runbook
234-
$job = Start-AzureRmAutomationRunbook @startParams
234+
$job = Start-AzAutomationRunbook @startParams
235235
```
236236

237237
The runbook runs, and you can check its status by running `$job.Status`.
238238

239239
The runbook gets the Resource Manager template and uses it to deploy a new Azure Storage account.
240240
You can see that the new storage account was created by running the following command:
241+
241242
```powershell
242-
Get-AzureRmStorageAccount
243+
Get-AzStorageAccount
243244
```
244245

245246
## Summary
246247

247-
That's it! Now you can use Azure Automation and Azure Storage,
248-
and Resource Manager templates to deploy all your Azure resources.
248+
That's it! Now you can use Azure Automation and Azure Storage with Resource Manager templates to deploy all your Azure resources.
249249

250250
## Next steps
251251

252-
* To learn more about Resource Manager templates, see [Azure Resource Manager overview](../azure-resource-manager/management/overview.md)
252+
* To learn more about Resource Manager templates, see [Azure Resource Manager overview](../azure-resource-manager/management/overview.md).
253253
* To get started with Azure Storage, see [Introduction to Azure Storage](../storage/common/storage-introduction.md).
254254
* To find other useful Azure Automation runbooks, see
255255
[Runbook and module galleries for Azure Automation](automation-runbook-gallery.md).
256-
* To find other useful Resource Manager templates, see [Azure Quickstart Templates](https://azure.microsoft.com/resources/templates/)
257-
258-
256+
* To find other useful Resource Manager templates, see [Azure Quickstart Templates](https://azure.microsoft.com/resources/templates/).
257+
* For a PowerShell cmdlet reference, see [Az.Automation](https://docs.microsoft.com/powershell/module/az.automation/?view=azps-3.7.0#automation
258+
).

0 commit comments

Comments
 (0)