You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
88
88
89
89
## Using a connection in a runbook or DSC configuration
90
90
@@ -108,7 +108,7 @@ You add a `Get-AutomationConnection` activity to a graphical runbook by right-cl
108
108
109
109

110
110
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.
Copy file name to clipboardExpand all lines: articles/automation/automation-create-alert-triggered-runbook.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,20 +29,20 @@ When an alert calls a runbook, the actual call is an HTTP POST request to the we
29
29
|Alert |Description|Payload schema |
30
30
|---------|---------|---------|
31
31
|[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)|
34
34
35
35
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.
36
36
37
37
## Create a runbook to handle alerts
38
38
39
39
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.
40
40
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.
42
42
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.
44
44
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.
46
46
47
47
Use this example to create a runbook called **Stop-AzureVmInResponsetoVMAlert**. You can modify the PowerShell script, and use it with many different resources.
Copy file name to clipboardExpand all lines: articles/automation/automation-create-standalone-account.md
+20-17Lines changed: 20 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,29 +12,28 @@ This article shows you how to create an Azure Automation account in the Azure po
12
12
13
13
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.
14
14
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:
16
16
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.
21
20
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.
23
22
24
23
## Permissions required to create an Automation account
25
24
26
25
To create or update an Automation account, and to complete the tasks described in this article, you must have the following privileges and permissions:
27
26
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).
29
28
* 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.
30
29
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.`
32
31
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.
34
33
35
34
To verify user roles:
36
35
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.
38
37
1. Select **Users and groups**.
39
38
1. Select **All users**.
40
39
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
49
48
50
49

> 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.
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.
63
66
1. For **Resource group**, enter or select a new or existing resource group.
64
67
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**.
66
69
67
70
> [!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.
@@ -174,10 +174,7 @@ Save the file locally as **DeployTemplate.ps1**.
174
174
175
175
## Import and publish the runbook into your Azure Automation account
176
176
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).
181
178
182
179
To import **DeployTemplate.ps1** into your Automation account as a PowerShell runbook,
0 commit comments