Set-AzTemplateSpec ` -Name storageSpec ` -Version 1.0a ` -ResourceGroupName templateSpecsRg ` -Location westus2 ` -TemplateFile ./mainTemplate.bicep ` -Tag @{Dept="Finance";Environment="Production"} 模板及其版本都可以有标记。 标记会根据指定的参数被应用或继承:展开...
若要以管理组中的资源组为目标,请添加模块。 使用 resourceGroup 函数设置scope 属性。 提供订阅 ID 和资源组名称。Bicep 复制 targetScope = 'managementGroup' param subscriptionID string param resourceGroupName string // module deployed to resource group in the management group module exampleModule '...
若要將管理群組內的資源群組設為目標,請新增模組。 使用resourceGroup 函式(部分機器翻譯) 來設定scope屬性。 提供訂用帳戶識別碼和資源群組名稱。 Bicep targetScope='managementGroup'paramsubscriptionIDstringparamresourceGroupNamestring// module deployed to resource group in the management groupmoduleexample...
az.getSecret(subscriptionId, resourceGroupName, keyVaultName, secretName, secretVersion) 函式可用於 .bicepparam 檔案中以擷取金鑰保存庫祕密。 如需詳細資訊,請參閱 getSecret。您只能從模組的 getSecret 區段內使用 params 函式。 您只能將其與 Microsoft.KeyVault/vaults 資源搭配使用。Bicep...
resourceType:资源的类型,如 Microsoft.Compute/virtualMachines。 resourceName1, ..., resourceNameN:资源的名称,可以使用 resource().name 引用当前资源的名称。 以下是一个示例,演示如何在 Bicep 中输出虚拟机资源的 ID: 代码语言:txt 复制 param virtualMachineName string param resourceGroupName string output ...
The case where the scope is specified here, such as \"scope: resourceGroup(exampleRG)\" without declaring the scope by targetScope. \n The case where extensions dependent on the symbolic name of spokeVnet are set as above. 1 is often added when you want to ref...
az resource list --resource-group SampleRG PowerShell Get-AzResource-ResourceGroupName SampleRG Azure Portal Figure: Azure Resources in the resource group. Bicep Modules The sample is composed of many Bicep modules, each deploying a different set of resources. The following table contains the Bicep...
在Bicep 中,可以使用 `resourceId()` 函数来输出资源的 ID。`resourceId()` 函数的语法如下: ``` resourceId(subscriptionId, re...
Create anAzure Resource Group. The name of all resources are generated automatically to avoid any conflicts. Create anUbuntu ServerVirtual Machine. You will be prompted for a password during the deployment. ANetwork Security Groupwith firewall rules is attached to the Virtual Machine. ...
Now, let’s create that storage account. This is done using theMicrosoft.Storage/storageAccountstype. Using thelocationparameter I previously defined to put the storage account in the same Azure region as the resource group. I’m also using string interpolation to set the name of the resource ...