Skip to content

Commit cdf0a8f

Browse files
authored
Merge pull request #111439 from BethWilke/branch116
Fixing task 1704284
2 parents 7299ce6 + 76143b7 commit cdf0a8f

10 files changed

+137
-134
lines changed

articles/automation/automation-connections.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ $ConnectionFieldValues = @{"ApplicationId" = $Application.ApplicationId; "Tenant
8484
New-AzAutomationConnection -ResourceGroupName $ResourceGroup -AutomationAccountName $AutomationAccountName -Name $ConnectionAssetName -ConnectionTypeName AzureServicePrincipal -ConnectionFieldValues $ConnectionFieldValues
8585
```
8686

87-
You are able to use the script to create the connection asset because when you create your Automation account, it automatically includes several global modules by default along with the connection type `AzureServicePrincipal` to create the `AzureRunAsConnection` connection asset. This is important to keep in mind, because if you attempt to create a new connection asset to connect to a service or application with a different authentication method, it will fail because the connection type is not already defined in your Automation account. For more information on how to create your own connection type for your custom or module from the [PowerShell Gallery](https://www.powershellgallery.com), see [Integration Modules](automation-integration-modules.md)
87+
You are able to use the script to create the connection asset because when you create your Automation account, it automatically includes several global modules by default along with the connection type `AzureServicePrincipal` to create the `AzureRunAsConnection` connection asset. This is important to keep in mind, because if you attempt to create a new connection asset to connect to a service or application with a different authentication method, it will fail because the connection type is not already defined in your Automation account. For more information on how to create your own connection type for your custom or module from the [PowerShell Gallery](https://www.powershellgallery.com), see [Integration Modules](automation-integration-modules.md).
8888

8989
## Using a connection in a runbook or DSC configuration
9090

@@ -108,7 +108,7 @@ You add a `Get-AutomationConnection` activity to a graphical runbook by right-cl
108108

109109
![add to canvas](media/automation-connections/connection-add-canvas.png)
110110

111-
The following image shows an example of using a connection in a graphical runbook. This is the same example shown above for authenticating using the Run As account with a textual runbook. This example uses the `Constant value` data set for the `Get RunAs Connection` activity that uses a connection object for authentication. A [pipeline link](automation-graphical-authoring-intro.md#links-and-workflow) is used here since the `ServicePrincipalCertificate` parameter set is expecting a single object.
111+
The following image shows an example of using a connection in a graphical runbook. This is the same example as shown above for authenticating using the Run As account with a textual runbook. This example uses the `Constant value` data set for the `Get RunAs Connection` activity that uses a connection object for authentication. A [pipeline link](automation-graphical-authoring-intro.md#links-and-workflow) is used here since the `ServicePrincipalCertificate` parameter set is expecting a single object.
112112

113113
![get connections](media/automation-connections/automation-get-connection-object.png)
114114

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,20 @@ When an alert calls a runbook, the actual call is an HTTP POST request to the we
2929
|Alert |Description|Payload schema |
3030
|---------|---------|---------|
3131
|[Common alert](../azure-monitor/platform/alerts-common-schema.md?toc=%2fazure%2fautomation%2ftoc.json)|The common alert schema that standardizes the consumption experience for alert notifications in Azure today.|Common alert payload schema|
32-
|[Activity log alert](../azure-monitor/platform/activity-log-alerts.md?toc=%2fazure%2fautomation%2ftoc.json) |Sends a notification when any new event in the Azure activity log matches specific conditions. For example, when a `Delete VM` operation occurs in **myProductionResourceGroup** or when a new Azure Service Health event with an **Active** status appears.| [Activity log alert payload schema](../azure-monitor/platform/activity-log-alerts-webhook.md) |
33-
|[Near real-time metric alert](../azure-monitor/platform/alerts-metric-near-real-time.md?toc=%2fazure%2fautomation%2ftoc.json) |Sends a notification faster than metric alerts when one or more platform-level metrics meet specified conditions. For example, when the value for **CPU %** on a VM is greater than **90**, and the value for **Network In** is greater than **500 MB** for the past 5 minutes.| [Near real-time metric alert payload schema](../azure-monitor/platform/alerts-webhooks.md#payload-schema) |
32+
|[Activity log alert](../azure-monitor/platform/activity-log-alerts.md?toc=%2fazure%2fautomation%2ftoc.json) |Sends a notification when any new event in the Azure activity log matches specific conditions. For example, when a `Delete VM` operation occurs in **myProductionResourceGroup** or when a new Azure Service Health event with an Active status appears.| [Activity log alert payload schema](../azure-monitor/platform/activity-log-alerts-webhook.md) |
33+
|[Near real-time metric alert](../azure-monitor/platform/alerts-metric-near-real-time.md?toc=%2fazure%2fautomation%2ftoc.json) |Sends a notification faster than metric alerts when one or more platform-level metrics meet specified conditions. For example, when the value for **CPU %** on a VM is greater than 90, and the value for **Network In** is greater than 500 MB for the past 5 minutes.| [Near real-time metric alert payload schema](../azure-monitor/platform/alerts-webhooks.md#payload-schema) |
3434

3535
Because the data that's provided by each type of alert is different, each alert type is handled differently. In the next section, you learn how to create a runbook to handle different types of alerts.
3636

3737
## Create a runbook to handle alerts
3838

3939
To use Automation with alerts, you need a runbook that has logic that manages the alert JSON payload that's passed to the runbook. The following example runbook must be called from an Azure alert.
4040

41-
As described in the preceding section, each type of alert has a different schema. The script takes in the webhook data in the `WebhookData` runbook input parameter from an alert. Then, the script evaluates the JSON payload to determine which alert type was used.
41+
As described in the preceding section, each type of alert has a different schema. The script takes the webhook data from an alert in the `WebhookData` runbook input parameter. Then, the script evaluates the JSON payload to determine which alert type is being used.
4242

43-
This example uses an alert from a VM. It retrieves the VM data from the payload, and then uses that information to stop the VM. The connection must be set up in the Automation account where the runbook is run. When using alerts to trigger runbooks, it is important to check the status of the alert in the runbook that is triggered. The runbook will trigger each time the alert changes state. Alerts have multiple states, the two most common states are `Activated` and `Resolved`. Check for this state in your runbook logic to ensure that your runbook does not run more than once. The example in this article shows how to look for `Activated` alerts only.
43+
This example uses an alert from a VM. It retrieves the VM data from the payload, and then uses that information to stop the VM. The connection must be set up in the Automation account where the runbook is run. When using alerts to trigger runbooks, it is important to check the alert status in the runbook that is triggered. The runbook triggers each time the alert changes state. Alerts have multiple states, with the two most common being Activated and Resolved. Check for state in your runbook logic to ensure that the runbook does not run more than once. The example in this article shows how to look for alerts with state Activated only.
4444

45-
The runbook uses the `AzureRunAsConnection` [Run As account](automation-create-runas-account.md) to authenticate with Azure to perform the management action against the VM.
45+
The runbook uses the connection asset `AzureRunAsConnection` [Run As account](automation-create-runas-account.md) to authenticate with Azure to perform the management action against the VM.
4646

4747
Use this example to create a runbook called **Stop-AzureVmInResponsetoVMAlert**. You can modify the PowerShell script, and use it with many different resources.
4848

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

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,28 @@ This article shows you how to create an Azure Automation account in the Azure po
1212

1313
With an Automation account, you can authenticate runbooks by managing resources in either Azure Resource Manager or the classic deployment model. One Automation Account can manage resources across all regions and subscriptions for a given tenant.
1414

15-
When you create an Automation account in the Azure portal, these accounts are automatically created:
15+
When you create an Automation account in the Azure portal, the **Run As** account is automatically created. This account does the following tasks:
1616

17-
* **Run As account**. This account does the following tasks:
18-
* Creates a service principal in Azure Active Directory (Azure AD).
19-
* Creates a certificate.
20-
* Assigns the Contributor Role-Based Access Control (RBAC), which manages Azure Resource Manager resources by using runbooks.
17+
* Creates a service principal in Azure Active Directory (Azure AD).
18+
* Creates a certificate.
19+
* Assigns the Contributor Role-Based Access Control (RBAC), which manages Azure Resource Manager resources by using runbooks.
2120

22-
With these accounts created for you, you can quickly start building and deploying runbooks to support your automation needs.
21+
With this account created for you, you can quickly start building and deploying runbooks to support your automation needs.
2322

2423
## Permissions required to create an Automation account
2524

2625
To create or update an Automation account, and to complete the tasks described in this article, you must have the following privileges and permissions:
2726

28-
* To create an Automation account, your Azure AD user account must be added to a role with permissions equivalent to the Owner role for **Microsoft. Automation** resources. For more information, see [Role-Based Access Control in Azure Automation](automation-role-based-access-control.md).
27+
* To create an Automation account, your Azure AD user account must be added to a role with permissions equivalent to the Owner role for `Microsoft.Automation` resources. For more information, see [Role-Based Access Control in Azure Automation](automation-role-based-access-control.md).
2928
* In the Azure portal, under **Azure Active Directory** > **MANAGE** > **User settings**, if **App registrations** is set to **Yes**, non-admin users in your Azure AD tenant can [register Active Directory applications](../active-directory/develop/howto-create-service-principal-portal.md#check-azure-subscription-permissions). If **App registrations** is set to **No**, the user who performs this action must be a global administrator in Azure AD.
3029

31-
If you aren't a member of the subscription's Active Directory instance before you are added to the subscription's global administrator/coadministrator role, you are added to Active Directory as a guest. In this scenario, you see this message on the **Add Automation Account** page: "You do not have permissions to create."
30+
If you aren't a member of the subscription's Active Directory instance before you're added to the subscription's global Administrator/Coadministrator role, you are added to Active Directory as a guest. In this scenario, you see this message on the Add Automation Account pane: `You do not have permissions to create.`
3231

33-
If a user is added to the global administrator/coadministrator role first, you can remove them from the subscription's Active Directory instance, and then readd them to the full User role in Active Directory.
32+
If a user is added to the global Administrator/Coadministrator role first, you can remove the user from the subscription's Active Directory instance. You can readd the user to the User role in Active Directory.
3433

3534
To verify user roles:
3635

37-
1. In the Azure portal, go to the **Azure Active Directory** pane.
36+
1. In the Azure portal, go to the Azure Active Directory pane.
3837
1. Select **Users and groups**.
3938
1. Select **All users**.
4039
1. After you select a specific user, select **Profile**. The value of the **User type** attribute under the user's profile should not be **Guest**.
@@ -49,30 +48,34 @@ To create an Azure Automation account in the Azure portal, complete the followin
4948

5049
![Search for and select Automation & Control in the Azure Marketplace](media/automation-create-standalone-account/automation-marketplace-select-create-automationacct.png)
5150

52-
1. On the next screen select **Create**.
51+
1. On the next screen, select **Create new**.
5352

5453
![Add Automation account](media/automation-create-standalone-account/automation-create-automationacct-properties.png)
5554

5655
> [!NOTE]
57-
> If you see the following message in the **Add Automation Account** pane, your account is not a member of the subscription Administrators role and a coadministrator of the subscription.
56+
> If you see the following message in the Add Automation Account pane, your account is not a member of the subscription Administrators role and a coadministrator of the subscription.
5857
>
5958
> ![Add Automation account warning](media/automation-create-standalone-account/create-account-without-perms.png)
6059
61-
1. In the **Add Automation Account** pane, in the **Name** box, enter a name for your new Automation account. This name cannot be changed after it is chosen. *Automation Account names are unique per region and resource group. Names for Automation Accounts that were deleted may not be immediately available.*
62-
1. If you have more than one subscription, in the **Subscription** box, specify the subscription you want to use for the new account.
60+
1. In the Add Automation Account pane, enter a name for your new Automation account in the **Name** field. You can't change this name after it's chosen.
61+
62+
> [!NOTE]
63+
> Automation account names are unique per region and resource group. Names for deleted Automation accounts might not be immediately available.
64+
65+
1. If you have more than one subscription, use the **Subscription** field to specify the subscription to use for the new account.
6366
1. For **Resource group**, enter or select a new or existing resource group.
6467
1. For **Location**, select an Azure datacenter location.
65-
1. For the **Create Azure Run As account** option, ensure that **Yes** is selected, and then select **Create**.
68+
1. For the **Create Azure Run As account** option, ensure that **Yes** is selected, and then click **Create**.
6669

6770
> [!NOTE]
68-
> If you choose not to create the Run As account by selecting **No** for **Create Azure Run As account**, a message appears in the **Add Automation Account** pane. Although the account is created in the Azure portal, the account doesn't have a corresponding authentication identity in your classic deployment model subscription or in the Azure Resource Manager subscription directory service. Therefore, the Automation account doesn't have access to resources in your subscription. This prevents any runbooks that reference this account from being able to authenticate and perform tasks against resources in those deployment models.
71+
> If you choose not to create the Run As account by selecting **No** for **Create Azure Run As account**, a message appears in the Add Automation Account pane. Although the account is created in the Azure portal, the account doesn't have a corresponding authentication identity in your classic deployment model subscription or in the Azure Resource Manager subscription directory service. Therefore, the Automation account doesn't have access to resources in your subscription. This prevents any runbooks that reference this account from being able to authenticate and perform tasks against resources in those deployment models.
6972
>
7073
> ![Add Automation account warning](media/automation-create-standalone-account/create-account-decline-create-runas-msg.png)
7174
>
7275
> When the service principal is not created, the Contributor role is not assigned.
7376
>
7477
75-
1. To track the progress of the Automation account creation, in the menu, select **Notifications**.
78+
1. To track the progress of the Automation account creation, select **Notifications** in the menu.
7679

7780
### Resources included
7881

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

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -109,15 +109,15 @@ Connect-AzAccount
109109
$key = Get-AzStorageAccountKey -ResourceGroupName 'MyAzureAccount' -Name 'MyStorageAccount'
110110
111111
# Create an Azure Storage context using the first access key
112-
$context = New-AzureStorageContext -StorageAccountName 'MyStorageAccount' -StorageAccountKey $key[0].value
112+
$context = New-AzStorageContext -StorageAccountName 'MyStorageAccount' -StorageAccountKey $key[0].value
113113
114114
# Create a file share named 'resource-templates' in your Azure Storage account
115-
$fileShare = New-AzureStorageShare -Name 'resource-templates' -Context $context
115+
$fileShare = New-AzStorageShare -Name 'resource-templates' -Context $context
116116
117117
# Add the TemplateTest.json file to the new file share
118118
# "TemplatePath" is the path where you saved the TemplateTest.json file
119119
$templateFile = 'C:\TemplatePath'
120-
Set-AzureStorageFileContent -ShareName $fileShare.Name -Context $context -Source $templateFile
120+
Set-AzStorageFileContent -ShareName $fileShare.Name -Context $context -Source $templateFile
121121
```
122122

123123
## Create the PowerShell runbook script
@@ -160,9 +160,9 @@ $Parameters = @{
160160
}
161161
162162
# Create a new context
163-
$Context = New-AzureStorageContext -StorageAccountName $StorageAccountName -StorageAccountKey $StorageAccountKey
163+
$Context = New-AzStorageContext -StorageAccountName $StorageAccountName -StorageAccountKey $StorageAccountKey
164164
165-
Get-AzureStorageFileContent -ShareName 'resource-templates' -Context $Context -path 'TemplateTest.json' -Destination 'C:\Temp'
165+
Get-AzStorageFileContent -ShareName 'resource-templates' -Context $Context -path 'TemplateTest.json' -Destination 'C:\Temp'
166166
167167
$TemplateFile = Join-Path -Path 'C:\Temp' -ChildPath $StorageFileName
168168
@@ -174,10 +174,7 @@ Save the file locally as **DeployTemplate.ps1**.
174174

175175
## Import and publish the runbook into your Azure Automation account
176176

177-
Now we use PowerShell to import the runbook into your Azure Automation account,
178-
and then publish the runbook.
179-
For information about how to import and publish a runbook in the Azure portal, see
180-
[Manage runbooks in Azure Automation](manage-runbooks.md).
177+
Now we use PowerShell to import the runbook into your Azure Automation account, and then publish the runbook. For information about how to import and publish a runbook in the Azure portal, see [Manage runbooks in Azure Automation](manage-runbooks.md).
181178

182179
To import **DeployTemplate.ps1** into your Automation account as a PowerShell runbook,
183180
run the following PowerShell commands:

0 commit comments

Comments
 (0)