Microsoft.網站/原始檔控制

Bicep 資源定義

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

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

使用範例

Azure 快速入門範例

下列 Azure 快速入門範本 包含用於部署此資源類型的 Bicep 範例。

Bicep 檔案 描述
App Service 快速入門 - Linux 應用程式 此範本可與 /azure/app-service/quickstart-arm-template 搭配使用
App Service 快速入門 - Windows 應用程式 此範本可與 /azure/app-service/quickstart-arm-template 搭配使用
App Service 快速入門 - Windows 應用程式 此範本可與 /azure/app-service/quickstart-arm-template 搭配使用
建立零觸控 Azure Cosmos 帳戶和 Azure Web 應用程式 此範本會建立 Azure Cosmos 帳戶、將 Cosmos DB 端點和金鑰插入 Azure Web 應用程式設定,然後從 GitHub 部署 ASP MVC Web 應用程式。
從 GitHub Web 應用程式部署 此範本可讓您建立連結至 GitHub 存放庫的 WebApp 連結。

資源格式

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

resource symbolicname 'Microsoft.Web/sites/sourcecontrols@2025-03-01' = {
  parent: resourceSymbolicName
  kind: 'string'
  name: 'web'
  properties: {
    branch: 'string'
    deploymentRollbackEnabled: bool
    gitHubActionConfiguration: {
      codeConfiguration: {
        runtimeStack: 'string'
        runtimeVersion: 'string'
      }
      containerConfiguration: {
        imageName: 'string'
        password: 'string'
        serverUrl: 'string'
        username: 'string'
      }
      generateWorkflowFile: bool
      isLinux: bool
    }
    isGitHubAction: bool
    isManualIntegration: bool
    isMercurial: bool
    repoUrl: 'string'
  }
}

屬性值

Microsoft.Web/sites/sourcecontrols

名字 描述 價值
類 資源種類。 字串
名字 資源名稱 'web' (必要)
父代 在 Bicep 中,您可以指定子資源的父資源。 只有在父資源外部宣告子資源時,才需要新增這個屬性。

如需詳細資訊,請參閱 父資源外部的子資源。
類型的資源符號名稱:網站
性能 SiteSourceControl 資源特定屬性 SiteSourceControlProperties

GitHubActionCodeConfiguration

名字 描述 價值
runtimeStack 運行時間堆疊可用來判斷程式碼基底應用程式的工作流程檔案內容。 字串
runtimeVersion (運行時版本) 運行時間版本可用來判斷工作流程檔案中要設定的組建版本。 字串

GitHubActionConfiguration

名字 描述 價值
codeConfiguration GitHub Action 程式代碼設定。 GitHubActionCodeConfiguration
containerConfiguration GitHub Action 容器組態。 GitHubActionContainerConfiguration
generateWorkflowFile 用來判斷工作流程檔案是否應該產生並寫入存放庫的工作流程選項。 布爾 (bool)
是Linux 這有助於判斷要選取的工作流程組態。 布爾 (bool)

GitHubActionContainerConfiguration

名字 描述 價值
圖像名稱 組建的映像名稱。 字串
密碼 用來將映像上傳至容器登錄的密碼。 字串

約束:
敏感性值。 以安全參數的形式傳入。
伺服器網址 將裝載組建之容器登錄的伺服器URL。 字串
使用者名稱 用來將映像上傳至容器登錄的用戶名稱。 字串

SiteSourceControlProperties

名字 描述 價值
branch 要用於部署的分支名稱。 字串
deploymentRollback已啟用 <程式代碼>true</code> 啟用部署復原;否則,<程式代碼>false</code>。 布爾 (bool)
gitHubActionConfiguration 如果已選取 GitHub Action,則比相關聯的組態還要多。 GitHubActionConfiguration
isGitHubAction 如果這是透過 GitHub 動作部署,<程式代碼>true</code>。 布爾 (bool)
isManual集成 <程式代碼>true</code> 限制為手動整合;<程式代碼>false</code> 啟用持續整合(這會將 Webhook 設定為 GitHub 之類的在線存放庫)。 布爾 (bool)
isMercurial <程式代碼>mercurial 存放庫的 true</code>;<程式代碼>Git 存放庫的 false</code>。 布爾 (bool)
repoUrl 的 存放庫或原始檔控制 URL。 字串

ARM 樣本資源定義

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

使用範例

Azure 快速入門範本

下列 Azure 快速入門範本 部署此資源類型。

範本 描述
App Service 快速入門 - Linux 應用程式

部署至 Azure
此範本可與 /azure/app-service/quickstart-arm-template 搭配使用
App Service 快速入門 - Windows 應用程式

部署至 Azure
此範本可與 /azure/app-service/quickstart-arm-template 搭配使用
App Service 快速入門 - Windows 應用程式

部署至 Azure
此範本可與 /azure/app-service/quickstart-arm-template 搭配使用
建立零觸控 Azure Cosmos 帳戶和 Azure Web 應用程式

部署至 Azure
此範本會建立 Azure Cosmos 帳戶、將 Cosmos DB 端點和金鑰插入 Azure Web 應用程式設定,然後從 GitHub 部署 ASP MVC Web 應用程式。
從 GitHub Web 應用程式部署

部署至 Azure
此範本可讓您建立連結至 GitHub 存放庫的 WebApp 連結。

資源格式

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

{
  "type": "Microsoft.Web/sites/sourcecontrols",
  "apiVersion": "2025-03-01",
  "name": "string",
  "kind": "string",
  "properties": {
    "branch": "string",
    "deploymentRollbackEnabled": "bool",
    "gitHubActionConfiguration": {
      "codeConfiguration": {
        "runtimeStack": "string",
        "runtimeVersion": "string"
      },
      "containerConfiguration": {
        "imageName": "string",
        "password": "string",
        "serverUrl": "string",
        "username": "string"
      },
      "generateWorkflowFile": "bool",
      "isLinux": "bool"
    },
    "isGitHubAction": "bool",
    "isManualIntegration": "bool",
    "isMercurial": "bool",
    "repoUrl": "string"
  }
}

屬性值

Microsoft.Web/sites/sourcecontrols

名字 描述 價值
apiVersion API 版本 '2025-03-01'
類 資源種類。 字串
名字 資源名稱 'web' (必要)
性能 SiteSourceControl 資源特定屬性 SiteSourceControlProperties
型別 資源類型 “Microsoft.Web/sites/sourcecontrols”

GitHubActionCodeConfiguration

名字 描述 價值
runtimeStack 運行時間堆疊可用來判斷程式碼基底應用程式的工作流程檔案內容。 字串
runtimeVersion (運行時版本) 運行時間版本可用來判斷工作流程檔案中要設定的組建版本。 字串

GitHubActionConfiguration

名字 描述 價值
codeConfiguration GitHub Action 程式代碼設定。 GitHubActionCodeConfiguration
containerConfiguration GitHub Action 容器組態。 GitHubActionContainerConfiguration
generateWorkflowFile 用來判斷工作流程檔案是否應該產生並寫入存放庫的工作流程選項。 布爾 (bool)
是Linux 這有助於判斷要選取的工作流程組態。 布爾 (bool)

GitHubActionContainerConfiguration

名字 描述 價值
圖像名稱 組建的映像名稱。 字串
密碼 用來將映像上傳至容器登錄的密碼。 字串

約束:
敏感性值。 以安全參數的形式傳入。
伺服器網址 將裝載組建之容器登錄的伺服器URL。 字串
使用者名稱 用來將映像上傳至容器登錄的用戶名稱。 字串

SiteSourceControlProperties

名字 描述 價值
branch 要用於部署的分支名稱。 字串
deploymentRollback已啟用 <程式代碼>true</code> 啟用部署復原;否則,<程式代碼>false</code>。 布爾 (bool)
gitHubActionConfiguration 如果已選取 GitHub Action,則比相關聯的組態還要多。 GitHubActionConfiguration
isGitHubAction 如果這是透過 GitHub 動作部署,<程式代碼>true</code>。 布爾 (bool)
isManual集成 <程式代碼>true</code> 限制為手動整合;<程式代碼>false</code> 啟用持續整合(這會將 Webhook 設定為 GitHub 之類的在線存放庫)。 布爾 (bool)
isMercurial <程式代碼>mercurial 存放庫的 true</code>;<程式代碼>Git 存放庫的 false</code>。 布爾 (bool)
repoUrl 的 存放庫或原始檔控制 URL。 字串

Terraform (AzAPI 提供者) 資源定義

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

  • 資源團體 關於每個 API 版本變更屬性的清單,請參見 變更日誌。

資源格式

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

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.Web/sites/sourcecontrols@2025-03-01"
  name = "string"
  parent_id = "string"
  body = {
    kind = "string"
    properties = {
      branch = "string"
      deploymentRollbackEnabled = bool
      gitHubActionConfiguration = {
        codeConfiguration = {
          runtimeStack = "string"
          runtimeVersion = "string"
        }
        containerConfiguration = {
          imageName = "string"
          password = "string"
          serverUrl = "string"
          username = "string"
        }
        generateWorkflowFile = bool
        isLinux = bool
      }
      isGitHubAction = bool
      isManualIntegration = bool
      isMercurial = bool
      repoUrl = "string"
    }
  }
}

屬性值

Microsoft.Web/sites/sourcecontrols

名字 描述 價值
類 資源種類。 字串
名字 資源名稱 'web' (必要)
父項識別碼 此資源為父系之資源的標識碼。 類型資源的標識碼:網站
性能 SiteSourceControl 資源特定屬性 SiteSourceControlProperties
型別 資源類型 “Microsoft.網站/網站/sourcecontrols@2025-03-01”

GitHubActionCodeConfiguration

名字 描述 價值
runtimeStack 運行時間堆疊可用來判斷程式碼基底應用程式的工作流程檔案內容。 字串
runtimeVersion (運行時版本) 運行時間版本可用來判斷工作流程檔案中要設定的組建版本。 字串

GitHubActionConfiguration

名字 描述 價值
codeConfiguration GitHub Action 程式代碼設定。 GitHubActionCodeConfiguration
containerConfiguration GitHub Action 容器組態。 GitHubActionContainerConfiguration
generateWorkflowFile 用來判斷工作流程檔案是否應該產生並寫入存放庫的工作流程選項。 布爾 (bool)
是Linux 這有助於判斷要選取的工作流程組態。 布爾 (bool)

GitHubActionContainerConfiguration

名字 描述 價值
圖像名稱 組建的映像名稱。 字串
密碼 用來將映像上傳至容器登錄的密碼。 字串

約束:
敏感性值。 以安全參數的形式傳入。
伺服器網址 將裝載組建之容器登錄的伺服器URL。 字串
使用者名稱 用來將映像上傳至容器登錄的用戶名稱。 字串

SiteSourceControlProperties

名字 描述 價值
branch 要用於部署的分支名稱。 字串
deploymentRollback已啟用 <程式代碼>true</code> 啟用部署復原;否則,<程式代碼>false</code>。 布爾 (bool)
gitHubActionConfiguration 如果已選取 GitHub Action,則比相關聯的組態還要多。 GitHubActionConfiguration
isGitHubAction 如果這是透過 GitHub 動作部署,<程式代碼>true</code>。 布爾 (bool)
isManual集成 <程式代碼>true</code> 限制為手動整合;<程式代碼>false</code> 啟用持續整合(這會將 Webhook 設定為 GitHub 之類的在線存放庫)。 布爾 (bool)
isMercurial <程式代碼>mercurial 存放庫的 true</code>;<程式代碼>Git 存放庫的 false</code>。 布爾 (bool)
repoUrl 的 存放庫或原始檔控制 URL。 字串