【Azure Developer】Azure Automation 自动化账号生成的时候怎么生成连接 与证书 (Connection & Certificate)

Azure Automation :The Azure Automation service provides a highly reliable and scalable workflow execution engine to automate frequently repeated management tasks. The processes are automated through runbooks, which are Windows PowerShell Workflows run in the Azure Automation execution engine. You can use this API to create, update, read, and delete automation resources, including runbooks and runbook jobs. In addition you can manage assets such as variables, schedules, Windows PowerShell modules, credentials, and certificates.

Azure 自动化服务提供了一个高度可靠和可扩展的工作流执行引擎,可以自动执行频繁重复的管理任务。 这些流程通过 runbook 自动完成,这些 runbook 是在 Azure 自动化执行引擎中运行的 Windows PowerShell 工作流。 可以使用此 API 来创建、更新、读取和删除自动化资源,包括 runbook 和 runbook 作业。 此外,还可以管理诸如变量、时间表、Windows PowerShell 模块、凭据和证书等资产。

Source : https://docs.microsoft.com/en-us/rest/api/automation/

问题描述

自动化账号( Automation Account )生成的时候怎么生成连接( Connection )与证书( Certificate )?

问题回答

在中国区Azure中创建Connection时,需要修改为中国区的ARM Endpoint。比如Connection的Endpoint (终结点)应为:

https://management.chinacloudapi.cn
/subscriptions/<subscriptionid>
/resourceGroups/< resourceGroups >/providers/Microsoft.Automation
/automationAccounts/< automationAccounts name>
/connections/<connectionname>?api-version=2015-10-31

请求示例可参考:https://docs.microsoft.com/en-us/rest/api/automation/connection/create-or-update#create-or-update-connection

Sample Request

PUT https://management.chinacloudapi.cn/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts
/myAutomationAccount28/connections/mysConnection?api-version=2015-10-31

Request Body

{
  "name": "mysConnection",
  "properties": {
    "description": "my description goes here",
    "connectionType": {
      "name": "Azure"
    },
    "fieldDefinitionValues": {
      "AutomationCertificateName": "mysCertificateName",
      "SubscriptionID": "subid"
    }
  }
}

Sample Response

  • Status code:201

参考资料

Automation REST API Reference: https://docs.microsoft.com/en-us/rest/api/automation/

当在复杂的环境中面临问题,格物之道需:浊而静之徐清,安以动之徐生。 云中,恰是如此!

原文地址:https://www.cnblogs.com/lulight/p/15360060.html