Microsoft.Resources 部署Scripts
Bicep 資源定義
deploymentScripts 資源類型可以使用目標作業進行部署:
- 資源群組 - 請參閱 資源群組部署命令
如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄。
備註
若要瞭解如何在部署期間執行腳本,請參閱 在 Bicep 中使用部署腳本 或在 ARM 範本中使用部署腳本。
資源格式
若要建立 Microsoft.Resources/deploymentScripts 資源,請將下列 Bicep 新增至您的範本。
resource symbolicname 'Microsoft.Resources/deploymentScripts@2023-08-01' = {
name: 'string'
location: 'string'
tags: {
tagName1: 'tagValue1'
tagName2: 'tagValue2'
}
kind: 'string'
identity: {
type: 'UserAssigned'
userAssignedIdentities: {
{customized property}: {}
}
}
// For remaining properties, see deploymentScripts objects
}
deploymentScripts 物件
設定 kind 屬性以指定物件的類型。
針對 AzureCLI,請使用:
kind: 'AzureCLI'
properties: {
arguments: 'string'
azCliVersion: 'string'
cleanupPreference: 'string'
containerSettings: {
containerGroupName: 'string'
subnetIds: [
{
id: 'string'
name: 'string'
}
]
}
environmentVariables: [
{
name: 'string'
secureValue: 'string'
value: 'string'
}
]
forceUpdateTag: 'string'
primaryScriptUri: 'string'
retentionInterval: 'string'
scriptContent: 'string'
storageAccountSettings: {
storageAccountKey: 'string'
storageAccountName: 'string'
}
supportingScriptUris: [
'string'
]
timeout: 'string'
}
針對 AzurePowerShell,請使用:
kind: 'AzurePowerShell'
properties: {
arguments: 'string'
azPowerShellVersion: 'string'
cleanupPreference: 'string'
containerSettings: {
containerGroupName: 'string'
subnetIds: [
{
id: 'string'
name: 'string'
}
]
}
environmentVariables: [
{
name: 'string'
secureValue: 'string'
value: 'string'
}
]
forceUpdateTag: 'string'
primaryScriptUri: 'string'
retentionInterval: 'string'
scriptContent: 'string'
storageAccountSettings: {
storageAccountKey: 'string'
storageAccountName: 'string'
}
supportingScriptUris: [
'string'
]
timeout: 'string'
}
屬性值
deploymentScripts
名稱 | 描述 | 值 |
---|---|---|
NAME | 資源名稱 | 字串 (必要) |
location | 部署腳本的 ACI 和記憶體帳戶的位置。 | 字串 (必要) |
tags | 資源標籤。 | 標記名稱和值的字典。 請參閱 範本中的標記 |
kind | 設定物件類型 | AzureCLI AzurePowerShell (必要) |
身分識別 | 選擇性屬性。 要用於此部署腳本的受控識別。 目前僅支援使用者指派的 MSI。 | ManagedServiceIdentity |
AzureCliScript
名稱 | 描述 | 值 |
---|---|---|
kind | 腳本的類型。 | 'AzureCLI' (必要) |
properties | Azure CLI 文本對象的屬性。 | 需要 AzureCliScriptProperties () |
AzureCliScriptProperties
名稱 | 描述 | 值 |
---|---|---|
引數 | 要傳遞至腳本的命令行自變數。 自變數會以空格分隔。 例如:-Name blue* -Location 'West US 2' | 字串 |
azCliVersion | 要使用的 Azure CLI 模組版本。 | 字串 (必要) |
cleanupPreference | 當腳本執行處於終端機狀態時,清除喜好設定。 默認設定為 『Always』。 | 'Always' 'OnExpiration' 'OnSuccess' |
containerSettings | 容器設定。 | ContainerConfiguration |
environmentVariables | 要傳遞至腳本的環境變數。 | EnvironmentVariable[] |
forceUpdateTag | 取得或設定部署腳本應該如何強制執行,即使腳本資源尚未變更也一樣。 可以是目前的時間戳記或 GUID。 | 字串 |
primaryScriptUri | 腳本的 URI。 這是外部腳本的進入點。 | 字串 |
retentionInterval | 服務在到達終端機狀態之後保留腳本資源的間隔。 當此持續時間到期時,將會刪除資源。 持續時間是以 ISO 8601 模式為基礎 (,例如 P1D 表示一天) 。 | 字串 (必要) |
scriptContent | 腳本本文。 | 字串 |
storageAccountSettings | 記憶體帳戶設定。 | StorageAccountConfiguration |
supportingScriptUris | 支援外部腳本的檔案。 | string[] |
timeout | ISO 8601 格式所指定的允許腳本運行時間上限。 預設值為 P1D | 字串 |
ContainerConfiguration
名稱 | 描述 | 值 |
---|---|---|
containerGroupName | 如果未指定容器組名,則會自動產生名稱。 未指定 『containerGroupName』 表示產生唯一名稱的系統,最後可能會將 Azure 原則標示為不符合規範。 當您有需要特定命名慣例的 Azure 原則 或想要完全控制名稱時,請使用 『containerGroupName』。 'containerGroupName' 屬性長度必須介於 1 到 63 個字元之間,必須只包含小寫字母、數位和破折號,而且不能以虛線開始或結束,且不允許連續虛線。 若要指定 'containerGroupName',請將下列物件新增至屬性: { “containerSettings”: { “containerGroupName”: “contoso-container” } }。 如果您不想指定 'containerGroupName',請勿新增 'containerSettings' 属性。 | 字串 約束: 最小長度 = 1 最大長度 = 63 |
subnetIds | 容器群組的子網資源標識碼。 | ContainerGroupSubnetId[] |
ContainerGroupSubnetId
名稱 | 描述 | 值 |
---|---|---|
id | 子網的資源標識碼。 | 字串 (必要) |
NAME | 子網的易記名稱。 | 字串 |
EnvironmentVariable
名稱 | 描述 | 值 |
---|---|---|
NAME | 環境變數的名稱。 | 字串 (必要) |
secureValue | 安全環境變數的值。 | 字串 約束: 敏感性值。 以安全參數的形式傳入。 |
值 | 環境變數的值。 | 字串 |
StorageAccountConfiguration
名稱 | 描述 | 值 |
---|---|---|
storageAccountKey | 儲存體帳戶存取金鑰。 | 字串 約束: 敏感性值。 以安全參數的形式傳入。 |
storageAccountName | 儲存體帳戶名稱。 | 字串 |
AzurePowerShellScript
名稱 | 描述 | 值 |
---|---|---|
kind | 腳本的類型。 | 'AzurePowerShell' (必要) |
properties | Azure PowerShell 文稿對象的屬性。 | 需要 AzurePowerShellScriptProperties () |
AzurePowerShellScriptProperties
名稱 | 描述 | 值 |
---|---|---|
引數 | 要傳遞至腳本的命令行自變數。 自變數會以空格分隔。 例如:-Name blue* -Location 'West US 2' | 字串 |
azPowerShellVersion | Azure PowerShell 要使用的模組版本。 | 字串 (必要) |
cleanupPreference | 當腳本執行處於終端機狀態時,清除喜好設定。 默認設定為 『Always』。 | 'Always' 'OnExpiration' 'OnSuccess' |
containerSettings | 容器設定。 | ContainerConfiguration |
environmentVariables | 要傳遞至腳本的環境變數。 | EnvironmentVariable[] |
forceUpdateTag | 取得或設定部署腳本應該如何強制執行,即使腳本資源尚未變更也一樣。 可以是目前的時間戳記或 GUID。 | 字串 |
primaryScriptUri | 腳本的 URI。 這是外部腳本的進入點。 | 字串 |
retentionInterval | 服務在到達終端機狀態之後保留腳本資源的間隔。 當此持續時間到期時,將會刪除資源。 持續時間是以 ISO 8601 模式為基礎 (,例如 P1D 表示一天) 。 | 字串 (必要) |
scriptContent | 腳本本文。 | 字串 |
storageAccountSettings | 記憶體帳戶設定。 | StorageAccountConfiguration |
supportingScriptUris | 支援外部腳本的檔案。 | string[] |
timeout | ISO 8601 格式所指定的允許腳本運行時間上限。 預設值為 P1D | 字串 |
ManagedServiceIdentity
名稱 | 描述 | 值 |
---|---|---|
類型 | 受控識別的類型。 | 'UserAssigned' |
userAssignedIdentities | 與資源相關聯的使用者指派受控識別清單。 密鑰是受控識別的 Azure 資源識別碼。 | ManagedServiceIdentityUserAssignedIdentities |
ManagedServiceIdentityUserAssignedIdentities
名稱 | 描述 | 值 |
---|---|---|
{自定義屬性} | UserAssignedIdentity |
UserAssignedIdentity
此物件不包含部署期間要設定的任何屬性。 所有屬性都是 ReadOnly。
快速入門範本
下列快速入門範本會部署此資源類型。
範本 | 描述 |
---|---|
min.io Azure 閘道 |
完全私人 min.io Azure 閘道部署,以提供 Blob 記憶體支援的 S3 相容記憶體 API |
建立 WordPress 網站 |
此範本會在容器實例上建立 WordPress 網站 |
使用 Azure Windows 基準的 Azure Image Builder |
建立 Azure Image Builder 環境並建置 Windows Server 映射,並套用最新的 Windows 匯報 和 Azure Windows 基準。 |
從 ZIP 封存 URL 匯入 VHD Blob |
根據特製化磁碟映射部署 虛擬機器 需要將 VHD 檔案匯入記憶體帳戶。 在單一 ZIP 中壓縮多個 VHD 檔案,而您取得擷取 ZIP 封存的 URL 時,此 ARM 範本可簡化作業:下載、擷取和匯入現有的記憶體帳戶 Blob 容器。 |
將檔案從 URI 複製到 Blob 記憶體容器 |
此課程模組會從 uri 下載檔案,並將其複製到 Azure storageAccount Blob 容器。 storageAccount 必須已經存在,而且來源檔案必須已暫存至 uri。 |
使用登錄建立容器應用程式和環境 |
從 Azure Container Registry Create具有基本容器應用程式的容器應用程式環境。 它也會部署Log Analytics工作區來儲存記錄。 |
使用 Container Apps 建立 Dapr pub-sub servicebus 應用程式 |
Create 使用 Container Apps 的 Dapr pub-sub servicebus 應用程式。 |
部署簡單的 Azure Spring Apps 微服務應用程式 |
此範本會部署簡單的 Azure Spring Apps 微服務應用程式,以在 Azure 上執行。 |
Front Door Standard/Premium 與靜態網站來源 |
此範本會建立 Front Door Standard/Premium 和 Azure 記憶體靜態網站,並設定 Front Door 將流量傳送至靜態網站。 |
Create 具有持續性記憶體的隨選 SFTP 伺服器 |
此範本示範使用 Azure 容器實例 (ACI) 的隨選 SFTP 伺服器。 |
Create Data Factory 複製數據工具的 Blob 快速入門 |
此範本會建立 Blob 記憶體,並上傳複製資料工具快速入門的檔案 |
Azure Data Factory 有更多可能 - 按兩下即可嘗試 Azure Data Factory |
此範本會為從 Azure Blob 複製活動建立數據處理站管線,並將其複製到另一個 Azure Blob |
設定開發箱服務 |
此範本會根據 Dev Box 快速入門指南建立所有 Dev Box 系統管理員資源。 您可以檢視所有已建立的資源,或直接移至 DevPortal.microsoft.com,以建立您的第一個開發箱。 |
Azure Container Service (AKS) 與 Helm |
使用 Helm 使用 Azure Container Service (AKS) 部署受控叢集 |
Create Azure Machine Learning 掃掠作業 |
此範本會建立 Azure Machine Learning 掃掠作業以進行超參數微調。 |
Azure 防火牆 Premium 的測試環境 |
此範本會建立具有進階功能的 Azure 防火牆 進階和防火牆原則,例如入侵檢查偵測 (IDPS) 、TLS 檢查和 Web 類別篩選 |
使用 ACR 工作建置容器映像 |
此範本會使用 DeploymentScript 協調 ACR,從程式代碼存放庫建置容器映射。 |
將容器映像匯入 ACR |
此範本會利用 bicep 登錄中的匯入 ACR 模組,將公用容器映像匯入 Azure Container Registry。 |
使用憑證 Create 應用程式閘道 |
此範本示範如何產生 金鑰保存庫 自我簽署憑證,然後從 應用程式閘道 參考。 |
使用部署腳本來建立 Azure AD 物件 |
此範例會使用部署腳本在 Azure Active Directory 中建立物件。 |
使用複雜輸入 & 輸出 Create 部署腳本 |
此範本示範將複雜輸入、輸出和記錄傳遞和讀取至 Az CLI 部署腳本的最佳做法 |
使用複雜輸入 & 輸出 Create 部署腳本 |
此範本示範將複雜輸入、輸出和記錄傳遞和讀取至 Az Powershell 部署腳本的最佳做法 |
Create ssh 金鑰並儲存在 KeyVault 中 |
此範本會使用 deploymentScript 資源來產生 ssh 金鑰,並將私鑰儲存在 keyVault 中。 |
部署靜態網站 |
使用支援記憶體帳戶部署靜態網站 |
使用遠端組建的Linux取用方案上的函式應用程式 |
此範本會在 Linux 取用方案上佈建函式應用程式,並在程式碼部署期間執行遠端建置。 應用程式會視需要執行,且每個執行都會向您計費,且不會有常設資源承諾。 |
Create Azure 虛擬網路 管理員和範例 VNET |
此範本會將 Azure 虛擬網路 Manager 和範例虛擬網路部署到具名資源群組中。 它支援多個連線拓撲和網路群組成員資格類型。 |
ARM 範本資源定義
deploymentScripts 資源類型可以使用目標作業進行部署:
- 資源群組 - 請參閱 資源群組部署命令
如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄。
備註
若要瞭解如何在部署期間執行腳本,請參閱 在 Bicep 中使用部署腳本 或在 ARM 範本中使用部署腳本。
資源格式
若要建立 Microsoft.Resources/deploymentScripts 資源,請將下列 JSON 新增至範本。
{
"type": "Microsoft.Resources/deploymentScripts",
"apiVersion": "2023-08-01",
"name": "string",
"location": "string",
"tags": {
"tagName1": "tagValue1",
"tagName2": "tagValue2"
},
"kind": "string",
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"{customized property}": {}
}
},
// For remaining properties, see deploymentScripts objects
}
deploymentScripts 物件
設定 kind 屬性以指定物件的類型。
針對 AzureCLI,請使用:
"kind": "AzureCLI",
"properties": {
"arguments": "string",
"azCliVersion": "string",
"cleanupPreference": "string",
"containerSettings": {
"containerGroupName": "string",
"subnetIds": [
{
"id": "string",
"name": "string"
}
]
},
"environmentVariables": [
{
"name": "string",
"secureValue": "string",
"value": "string"
}
],
"forceUpdateTag": "string",
"primaryScriptUri": "string",
"retentionInterval": "string",
"scriptContent": "string",
"storageAccountSettings": {
"storageAccountKey": "string",
"storageAccountName": "string"
},
"supportingScriptUris": [ "string" ],
"timeout": "string"
}
針對 AzurePowerShell,請使用:
"kind": "AzurePowerShell",
"properties": {
"arguments": "string",
"azPowerShellVersion": "string",
"cleanupPreference": "string",
"containerSettings": {
"containerGroupName": "string",
"subnetIds": [
{
"id": "string",
"name": "string"
}
]
},
"environmentVariables": [
{
"name": "string",
"secureValue": "string",
"value": "string"
}
],
"forceUpdateTag": "string",
"primaryScriptUri": "string",
"retentionInterval": "string",
"scriptContent": "string",
"storageAccountSettings": {
"storageAccountKey": "string",
"storageAccountName": "string"
},
"supportingScriptUris": [ "string" ],
"timeout": "string"
}
屬性值
deploymentScripts
名稱 | 描述 | 值 |
---|---|---|
類型 | 資源類型 | 'Microsoft.Resources/deploymentScripts' |
apiVersion | 資源 API 版本 | '2023-08-01' |
NAME | 資源名稱 | 字串 (必要) |
location | 部署腳本的 ACI 和記憶體帳戶的位置。 | 字串 (必要) |
tags | 資源標籤。 | 標記名稱和值的字典。 請參閱 範本中的標記 |
kind | 設定物件類型 | AzureCLI AzurePowerShell (必要) |
身分識別 | 選擇性屬性。 要用於此部署腳本的受控識別。 目前僅支援使用者指派的 MSI。 | ManagedServiceIdentity |
AzureCliScript
名稱 | 描述 | 值 |
---|---|---|
kind | 腳本的類型。 | 'AzureCLI' (必要) |
properties | Azure CLI 文本對象的屬性。 | 需要 AzureCliScriptProperties () |
AzureCliScriptProperties
名稱 | 描述 | 值 |
---|---|---|
引數 | 要傳遞至腳本的命令行自變數。 自變數會以空格分隔。 例如:-Name blue* -Location 'West US 2' | 字串 |
azCliVersion | 要使用的 Azure CLI 模組版本。 | 字串 (必要) |
cleanupPreference | 當腳本執行處於終端機狀態時,清除喜好設定。 默認設定為 『Always』。 | 'Always' 'OnExpiration' 'OnSuccess' |
containerSettings | 容器設定。 | ContainerConfiguration |
environmentVariables | 要傳遞至腳本的環境變數。 | EnvironmentVariable[] |
forceUpdateTag | 取得或設定部署腳本應該如何強制執行,即使腳本資源尚未變更也一樣。 可以是目前的時間戳記或 GUID。 | 字串 |
primaryScriptUri | 腳本的 URI。 這是外部腳本的進入點。 | 字串 |
retentionInterval | 服務在到達終端機狀態之後保留腳本資源的間隔。 當此持續時間到期時,將會刪除資源。 持續時間是以 ISO 8601 模式為基礎 (,例如 P1D 表示一天) 。 | 字串 (必要) |
scriptContent | 腳本本文。 | 字串 |
storageAccountSettings | 記憶體帳戶設定。 | StorageAccountConfiguration |
supportingScriptUris | 支援外部腳本的檔案。 | string[] |
timeout | ISO 8601 格式所指定的允許腳本運行時間上限。 預設值為 P1D | 字串 |
ContainerConfiguration
名稱 | 描述 | 值 |
---|---|---|
containerGroupName | 如果未指定容器組名,則會自動產生名稱。 未指定 『containerGroupName』 表示產生唯一名稱的系統,最後可能會將 Azure 原則標示為不符合規範。 當您有需要特定命名慣例的 Azure 原則 或想要完全控制名稱時,請使用 『containerGroupName』。 'containerGroupName' 屬性長度必須介於 1 到 63 個字元之間,必須只包含小寫字母、數位和破折號,而且不能以虛線開始或結束,且不允許連續虛線。 若要指定 'containerGroupName',請將下列物件新增至屬性: { “containerSettings”: { “containerGroupName”: “contoso-container” } }。 如果您不想指定 'containerGroupName',請勿新增 'containerSettings' 属性。 | 字串 約束: 最小長度 = 1 最大長度 = 63 |
subnetIds | 容器群組的子網資源標識碼。 | ContainerGroupSubnetId[] |
ContainerGroupSubnetId
名稱 | 描述 | 值 |
---|---|---|
id | 子網的資源標識碼。 | 字串 (必要) |
NAME | 子網的易記名稱。 | 字串 |
EnvironmentVariable
名稱 | 描述 | 值 |
---|---|---|
NAME | 環境變數的名稱。 | 字串 (必要) |
secureValue | 安全環境變數的值。 | 字串 約束: 敏感性值。 以安全參數的形式傳入。 |
值 | 環境變數的值。 | 字串 |
StorageAccountConfiguration
名稱 | 描述 | 值 |
---|---|---|
storageAccountKey | 儲存體帳戶存取金鑰。 | 字串 約束: 敏感性值。 以安全參數的形式傳入。 |
storageAccountName | 儲存體帳戶名稱。 | 字串 |
AzurePowerShellScript
名稱 | 描述 | 值 |
---|---|---|
kind | 腳本的類型。 | 'AzurePowerShell' (必要) |
properties | Azure PowerShell 文稿對象的屬性。 | 需要 AzurePowerShellScriptProperties () |
AzurePowerShellScriptProperties
名稱 | 描述 | 值 |
---|---|---|
引數 | 要傳遞至腳本的命令行自變數。 自變數會以空格分隔。 例如:-Name blue* -Location 'West US 2' | 字串 |
azPowerShellVersion | Azure PowerShell 要使用的模組版本。 | 需要字串 () |
cleanupPreference | 當腳本執行處於終端狀態時,清除喜好設定。 默認設定為 『Always』。 | 'Always' 'OnExpiration' 'OnSuccess' |
containerSettings | 容器設定。 | ContainerConfiguration |
environmentVariables | 要傳遞至腳本的環境變數。 | EnvironmentVariable[] |
forceUpdateTag | 取得或設定部署腳本應該如何強制執行,即使腳本資源尚未變更也一樣。 可以是目前的時間戳記或 GUID。 | 字串 |
primaryScriptUri | 腳本的 URI。 這是外部腳本的進入點。 | 字串 |
retentionInterval | 服務在到達終端狀態之後保留腳本資源的間隔。 此持續時間到期時,將會刪除資源。 持續時間是以 ISO 8601 模式為基礎 (,例如 P1D 表示一天) 。 | 需要字串 () |
scriptContent | 腳本本文。 | 字串 |
storageAccountSettings | 記憶體帳戶設定。 | StorageAccountConfiguration |
supportingScriptUris | 支援外部腳本的檔案。 | string[] |
timeout | 以 ISO 8601 格式指定的允許腳本運行時間上限。 預設值為 P1D | 字串 |
ManagedServiceIdentity
名稱 | 描述 | 值 |
---|---|---|
類型 | 受控識別的類型。 | 'UserAssigned' |
userAssignedIdentities | 與資源相關聯的使用者指派受控識別清單。 密鑰是受控識別的 Azure 資源識別碼。 | ManagedServiceIdentityUserAssignedIdentities |
ManagedServiceIdentityUserAssignedIdentities
名稱 | 描述 | 值 |
---|---|---|
{自定義屬性} | UserAssignedIdentity |
UserAssignedIdentity
此物件不包含部署期間要設定的任何屬性。 所有屬性都是 ReadOnly。
快速入門範本
下列快速入門範本會部署此資源類型。
範本 | 描述 |
---|---|
min.io Azure 閘道 |
完全私人 min.io Azure 閘道部署,以提供由 Blob 記憶體支援的 S3 相容記憶體 API |
建立 WordPress 網站 |
此範本會在容器實例上建立 WordPress 網站 |
使用 Azure Windows 基準的 Azure Image Builder |
建立 Azure Image Builder 環境,並建置 Windows Server 映射,並套用最新的 Windows 匯報 和 Azure Windows 基準。 |
從 ZIP 封存 URL 匯入 VHD Blob |
根據特殊化磁碟映射部署 虛擬機器,需要將 VHD 檔案匯入記憶體帳戶。 在單一 ZIP 中壓縮了多個 VHD 檔案,而且您取得用來擷取 ZIP 封存的 URL 時,此 ARM 範本會簡化作業:下載、擷取和匯入現有的記憶體帳戶 Blob 容器。 |
將檔案從 URI 複製到 Blob 記憶體容器 |
此模組會從 URI 下載檔案,並將它複製到 Azure storageAccount Blob 容器。 storageAccount 必須已經存在,而且來源檔案必須已暫存至 URI。 |
使用登錄建立容器應用程式和環境 |
從 Azure Container Registry Create具有基本容器應用程式的容器應用程式環境。 它也會部署Log Analytics工作區來儲存記錄。 |
使用 Container Apps 建立 Dapr pub-sub servicebus 應用程式 |
使用 Container Apps Create Dapr pub-sub servicebus 應用程式。 |
部署簡單的 Azure Spring Apps 微服務應用程式 |
此範本會部署簡單的 Azure Spring Apps 微服務應用程式,以在 Azure 上執行。 |
具有靜態網站來源的 Front Door Standard/Premium |
此範本會建立 Front Door Standard/Premium 和 Azure 記憶體靜態網站,並設定 Front Door 將流量傳送至靜態網站。 |
Create 具有永續性記憶體的隨選 SFTP 伺服器 |
此範本示範使用 Azure 容器實例的隨選 SFTP 伺服器, (ACI) 。 |
Create Data Factory 複製數據工具的 Blob 快速入門 |
此範本會建立 Blob 記憶體,並上傳複製資料工具的檔案快速入門 |
Azure Data Factory 還有更多可能 - 按兩下即可嘗試 Azure Data Factory |
此範本會為從 Azure Blob 複製到另一個 Azure Blob 的複製活動建立數據處理站管線 |
設定開發箱服務 |
此範本會根據 Dev Box 快速入門指南建立所有 Dev Box 系統管理員資源。 您可以檢視所有已建立的資源,或直接移至 DevPortal.microsoft.com 以建立您的第一個 Dev Box。 |
Azure Container Service (AKS) 與 Helm |
使用 Azure Container Service (AKS) 與 Helm 部署受控叢集 |
Create Azure Machine Learning 掃掠作業 |
此範本會建立用於超參數微調的 Azure Machine Learning 掃掠作業。 |
Azure 防火牆 Premium 的測試環境 |
此範本會建立具有進階功能的 Azure 防火牆 進階和防火牆原則,例如入侵檢測 (IDPS) 、TLS 檢查和 Web 類別篩選 |
使用 ACR 工作建置容器映像 |
此範本會使用 DeploymentScript 協調 ACR,從程式代碼存放庫建置容器映射。 |
將容器映像匯入 ACR |
此範本會利用 bicep 登錄中的匯入 ACR 模組,將公用容器映像匯入 Azure Container Registry。 |
使用憑證 Create 應用程式閘道 |
此範本示範如何產生 金鑰保存庫 自我簽署憑證,然後從 應用程式閘道 參考。 |
使用部署腳本建立 Azure AD 物件 |
此範例會使用部署腳本在 Azure Active Directory 中建立物件。 |
使用複雜輸入 & 輸出 Create 部署腳本 |
此範本示範傳遞和讀取複雜輸入、輸出和記錄至 Az CLI 部署腳本的最佳做法 |
使用複雜輸入 & 輸出 Create 部署腳本 |
此範本示範將複雜輸入、輸出和記錄傳遞和讀取至 Az Powershell 部署腳本的最佳做法 |
Create ssh 金鑰並儲存在 KeyVault 中 |
此範本會使用 deploymentScript 資源來產生 ssh 金鑰,並將私鑰儲存在 keyVault 中。 |
部署靜態網站 |
使用支援記憶體帳戶部署靜態網站 |
使用遠端組建的Linux使用量方案上的函式應用程式 |
此範本會在 Linux 使用量方案上佈建函式應用程式,並在程式碼部署期間執行遠端建置。 應用程式會視需要執行,而且每個執行都會向您收取費用,而不需要常設資源承諾。 |
Create Azure 虛擬網路 Manager 和範例 VNET |
此範本會將 Azure 虛擬網路 Manager 和範例虛擬網路部署到具名資源群組中。 它支援多個連線拓撲和網路群組成員資格類型。 |
Terraform (AzAPI 提供者) 資源定義
deploymentScripts 資源類型可以使用目標作業進行部署:
- 資源群組
如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄檔。
資源格式
若要建立 Microsoft.Resources/deploymentScripts 資源,請將下列 Terraform 新增至範本。
resource "azapi_resource" "symbolicname" {
type = "Microsoft.Resources/deploymentScripts@2023-08-01"
name = "string"
location = "string"
parent_id = "string"
tags = {
tagName1 = "tagValue1"
tagName2 = "tagValue2"
}
identity {
type = "UserAssigned"
identity_ids = []
}
// For remaining properties, see deploymentScripts objects
body = jsonencode({
kind = "string"
})
}
deploymentScripts 物件
設定 kind 屬性以指定物件的類型。
針對 AzureCLI,請使用:
kind = "AzureCLI"
properties = {
arguments = "string"
azCliVersion = "string"
cleanupPreference = "string"
containerSettings = {
containerGroupName = "string"
subnetIds = [
{
id = "string"
name = "string"
}
]
}
environmentVariables = [
{
name = "string"
secureValue = "string"
value = "string"
}
]
forceUpdateTag = "string"
primaryScriptUri = "string"
retentionInterval = "string"
scriptContent = "string"
storageAccountSettings = {
storageAccountKey = "string"
storageAccountName = "string"
}
supportingScriptUris = [
"string"
]
timeout = "string"
}
針對 AzurePowerShell,請使用:
kind = "AzurePowerShell"
properties = {
arguments = "string"
azPowerShellVersion = "string"
cleanupPreference = "string"
containerSettings = {
containerGroupName = "string"
subnetIds = [
{
id = "string"
name = "string"
}
]
}
environmentVariables = [
{
name = "string"
secureValue = "string"
value = "string"
}
]
forceUpdateTag = "string"
primaryScriptUri = "string"
retentionInterval = "string"
scriptContent = "string"
storageAccountSettings = {
storageAccountKey = "string"
storageAccountName = "string"
}
supportingScriptUris = [
"string"
]
timeout = "string"
}
屬性值
deploymentScripts
名稱 | 描述 | 值 |
---|---|---|
類型 | 資源類型 | “Microsoft.Resources/deploymentScripts@2023-08-01” |
NAME | 資源名稱 | 需要字串 () |
location | 部署腳本的 ACI 和記憶體帳戶的位置。 | 需要字串 () |
parent_id | 若要部署至資源群組,請使用該資源群組的標識碼。 | 需要字串 () |
tags | 資源標籤。 | 標記名稱和值的字典。 |
kind | 設定物件類型 | AzureCLI 需要 AzurePowerShell () |
身分識別 | 選擇性屬性。 要用於此部署腳本的受控識別。 目前僅支援使用者指派的 MSI。 | ManagedServiceIdentity |
AzureCliScript
名稱 | 描述 | 值 |
---|---|---|
kind | 腳本的類型。 | “AzureCLI” (必要) |
properties | Azure CLI 文本對象的屬性。 | 需要 AzureCliScriptProperties () |
AzureCliScriptProperties
名稱 | 描述 | 值 |
---|---|---|
引數 | 要傳遞至腳本的命令行自變數。 自變數會以空格分隔。 例如:-Name blue* -Location 'West US 2' | 字串 |
azCliVersion | 要使用的 Azure CLI 模組版本。 | 需要字串 () |
cleanupPreference | 當腳本執行處於終端狀態時,清除喜好設定。 默認設定為 『Always』。 | “Always” “OnExpiration” “OnSuccess” |
containerSettings | 容器設定。 | ContainerConfiguration |
environmentVariables | 要傳遞至腳本的環境變數。 | EnvironmentVariable[] |
forceUpdateTag | 取得或設定部署腳本應該如何強制執行,即使腳本資源尚未變更也一樣。 可以是目前的時間戳記或 GUID。 | 字串 |
primaryScriptUri | 腳本的 URI。 這是外部腳本的進入點。 | 字串 |
retentionInterval | 服務在到達終端狀態之後保留腳本資源的間隔。 此持續時間到期時,將會刪除資源。 持續時間是以 ISO 8601 模式為基礎 (,例如 P1D 表示一天) 。 | 需要字串 () |
scriptContent | 腳本本文。 | 字串 |
storageAccountSettings | 記憶體帳戶設定。 | StorageAccountConfiguration |
supportingScriptUris | 支援外部腳本的檔案。 | string[] |
timeout | 以 ISO 8601 格式指定的允許腳本運行時間上限。 預設值為 P1D | 字串 |
ContainerConfiguration
名稱 | 描述 | 值 |
---|---|---|
containerGroupName | 如果未指定容器組名,則會自動產生名稱。 未指定 『containerGroupName』 表示產生唯一名稱的系統,最後可能會將 Azure 原則標示為不符合規範。 當您有需要特定命名慣例的 Azure 原則,或想要完全控制名稱時,請使用 『containerGroupName』。 'containerGroupName' 屬性長度必須介於 1 到 63 個字元之間,且只能包含小寫字母、數位和破折號,而且不能以虛線開頭或結尾,而且不允許連續虛線。 若要指定 'containerGroupName',請將下列物件新增至屬性: { “containerSettings”: { “containerGroupName”: “contoso-container” } }。 如果您不想指定 'containerGroupName',則請勿新增 'containerSettings' 属性。 | 字串 約束: 最小長度 = 1 最大長度 = 63 |
subnetIds | 容器群組的子網資源標識碼。 | ContainerGroupSubnetId[] |
ContainerGroupSubnetId
名稱 | 描述 | 值 |
---|---|---|
id | 子網的資源標識碼。 | 需要字串 () |
NAME | 子網的易記名稱。 | 字串 |
EnvironmentVariable
名稱 | 描述 | 值 |
---|---|---|
NAME | 環境變數的名稱。 | 需要字串 () |
secureValue | 安全環境變數的值。 | 字串 約束: 敏感性值。 以安全參數的形式傳入。 |
值 | 環境變數的值。 | 字串 |
StorageAccountConfiguration
名稱 | 描述 | 值 |
---|---|---|
storageAccountKey | 儲存體帳戶存取金鑰。 | 字串 約束: 敏感性值。 以安全參數的形式傳入。 |
storageAccountName | 儲存體帳戶名稱。 | 字串 |
AzurePowerShellScript
名稱 | 描述 | 值 |
---|---|---|
kind | 腳本的類型。 | “AzurePowerShell” (必要) |
properties | Azure PowerShell 文稿對象的屬性。 | 需要 AzurePowerShellScriptProperties () |
AzurePowerShellScriptProperties
名稱 | 描述 | 值 |
---|---|---|
引數 | 要傳遞至腳本的命令行自變數。 自變數會以空格分隔。 例如:-Name blue* -Location 'West US 2' | 字串 |
azPowerShellVersion | Azure PowerShell 要使用的模組版本。 | 字串 (必要) |
cleanupPreference | 當腳本執行處於終端機狀態時,清除喜好設定。 默認設定為 『Always』。 | “Always” “OnExpiration” “OnSuccess” |
containerSettings | 容器設定。 | ContainerConfiguration |
environmentVariables | 要傳遞至腳本的環境變數。 | EnvironmentVariable[] |
forceUpdateTag | 取得或設定部署腳本應該如何強制執行,即使腳本資源尚未變更也一樣。 可以是目前的時間戳記或 GUID。 | 字串 |
primaryScriptUri | 腳本的 URI。 這是外部腳本的進入點。 | 字串 |
retentionInterval | 服務在到達終端機狀態之後保留腳本資源的間隔。 當此持續時間到期時,將會刪除資源。 持續時間是以 ISO 8601 模式為基礎 (,例如 P1D 表示一天) 。 | 字串 (必要) |
scriptContent | 腳本本文。 | 字串 |
storageAccountSettings | 記憶體帳戶設定。 | StorageAccountConfiguration |
supportingScriptUris | 支援外部腳本的檔案。 | string[] |
timeout | ISO 8601 格式所指定的允許腳本運行時間上限。 預設值為 P1D | 字串 |
ManagedServiceIdentity
名稱 | 描述 | 值 |
---|---|---|
類型 | 受控識別的類型。 | “UserAssigned” |
identity_ids | 與資源相關聯的使用者指派受控識別清單。 密鑰是受控識別的 Azure 資源識別碼。 | 使用者身分識別標識碼的陣列。 |
ManagedServiceIdentityUserAssignedIdentities
名稱 | 描述 | 值 |
---|---|---|
{自定義屬性} | UserAssignedIdentity |
UserAssignedIdentity
此物件不包含部署期間要設定的任何屬性。 所有屬性都是 ReadOnly。
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應