Microsoft.Web 源控件 2015-08-01

Bicep 資源定義

sourcecontrols 資源類型可以使用目標作業來部署:

如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄檔。

使用範例

Bicep 範例

部署 App Service GitHub 權杖的基本範例。

targetScope = 'tenant'

param resourceName string = 'acctest0001'
param location string = 'eastus'
@secure()
@description('The GitHub access token for source control integration')
param githubToken string
@secure()
@description('The GitHub token secret for source control integration')
param githubTokenSecret string

resource sourcecontrol 'Microsoft.Web/sourcecontrols@2021-02-01' = {
  name: 'GitHub'
  properties: {
    token: githubToken
    tokenSecret: githubTokenSecret
  }
}

資源格式

若要建立 Microsoft.Web/sourcecontrols 資源,請將下列 Bicep 新增至範本。

resource symbolicname 'Microsoft.Web/sourcecontrols@2015-08-01' = {
  kind: 'string'
  location: 'string'
  name: 'string'
  properties: {
    expirationTime: 'string'
    name: 'string'
    refreshToken: 'string'
    token: 'string'
    tokenSecret: 'string'
  }
  tags: {
    {customized property}: 'string'
  }
}

屬性值

Microsoft.Web/sourcecontrols

名字 描述 價值
類 資源種類 字串
位置 資源位置 字串 (必要)
名字 資源名稱 字串 (必要)
性能 SourceControl屬性
標籤 資源標籤 標記名稱和值的字典。 請參閱範本中的 標籤

資源標籤

名字 描述 價值

SourceControl屬性

名字 描述 價值
到期時間 OAuth 令牌到期 字串
名字 名稱或原始檔控制類型 字串
refreshToken OAuth 重新整理令牌 字串
Token OAuth 存取令牌 字串
令牌金鑰 OAuth 存取令牌秘密 字串

ARM 樣本資源定義

sourcecontrols 資源類型可以使用目標作業來部署:

使用範例

資源格式

若要建立 Microsoft.Web/sourcecontrols 資源,請將下列 JSON 新增至範本。

{
  "type": "Microsoft.Web/sourcecontrols",
  "apiVersion": "2015-08-01",
  "name": "string",
  "kind": "string",
  "location": "string",
  "properties": {
    "expirationTime": "string",
    "name": "string",
    "refreshToken": "string",
    "token": "string",
    "tokenSecret": "string"
  },
  "tags": {
    "{customized property}": "string"
  }
}

屬性值

Microsoft.Web/sourcecontrols

名字 描述 價值
apiVersion API 版本 '2015-08-01'
類 資源種類 字串
位置 資源位置 字串 (必要)
名字 資源名稱 字串 (必要)
性能 SourceControl屬性
標籤 資源標籤 標記名稱和值的字典。 請參閱範本中的 標籤
型別 資源類型 “Microsoft.Web/sourcecontrols”

資源標籤

名字 描述 價值

SourceControl屬性

名字 描述 價值
到期時間 OAuth 令牌到期 字串
名字 名稱或原始檔控制類型 字串
refreshToken OAuth 重新整理令牌 字串
Token OAuth 存取令牌 字串
令牌金鑰 OAuth 存取令牌秘密 字串

Terraform (AzAPI 提供者) 資源定義

sourcecontrols 資源類型可以使用目標作業來部署:

  • 租戶 關於每個 API 版本變更屬性的清單,請參見 變更日誌。

使用範例

Terraform 範例

部署 App Service GitHub 權杖的基本範例。

terraform {
  required_providers {
    azapi = {
      source = "Azure/azapi"
    }
  }
}

provider "azapi" {
  skip_provider_registration = false
}

variable "resource_name" {
  type    = string
  default = "acctest0001"
}

variable "location" {
  type    = string
  default = "eastus"
}

variable "github_token" {
  type        = string
  description = "The GitHub access token for source control integration"
  sensitive   = true
}

variable "github_token_secret" {
  type        = string
  description = "The GitHub token secret for source control integration"
  sensitive   = true
}

resource "azapi_update_resource" "sourcecontrol" {
  type      = "Microsoft.Web/sourcecontrols@2021-02-01"
  parent_id = "/"
  name      = "GitHub"
  body = {
    properties = {
      token       = var.github_token
      tokenSecret = var.github_token_secret
    }
  }
  response_export_values = ["*"]
}

資源格式

若要建立 Microsoft.Web/sourcecontrols 資源,請將下列 Terraform 新增至範本。

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.Web/sourcecontrols@2015-08-01"
  name = "string"
  parent_id = "string"
  location = "string"
  tags = {
    {customized property} = "string"
  }
  body = {
    kind = "string"
    properties = {
      expirationTime = "string"
      name = "string"
      refreshToken = "string"
      token = "string"
      tokenSecret = "string"
    }
  }
}

屬性值

Microsoft.Web/sourcecontrols

名字 描述 價值
類 資源種類 字串
位置 資源位置 字串 (必要)
名字 資源名稱 字串 (必要)
性能 SourceControl屬性
標籤 資源標籤 標記名稱和值的字典。
型別 資源類型 “Microsoft.Web/sourcecontrols@2015-08-01”

資源標籤

名字 描述 價值

SourceControl屬性

名字 描述 價值
到期時間 OAuth 令牌到期 字串
名字 名稱或原始檔控制類型 字串
refreshToken OAuth 重新整理令牌 字串
Token OAuth 存取令牌 字串
令牌金鑰 OAuth 存取令牌秘密 字串