我们正在编写Azure Resource Manager模板.我们使用以下部署模板架构,因为它是我们在示例中看到的那个.
http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json#
Run Code Online (Sandbox Code Playgroud)
它是从2014年初开始的.我们在哪里可以找到更新的模式版本列表?
我们查看了资源管理器提供程序,区域,API版本和模式的列表.它引用了每个提供程序的模式,而不是整个模板.
当我们找到更新的架构列表时,我们如何评估要使用的部署模板架构?最近更好吗?
是否可以检索正在部署 ARM 模板的用户的 ID?
有一个subscription()函数可以检索有关模板正在部署到的订阅的信息,包括订阅 ID,我希望主体有类似的东西。
我刚刚开始失败,不知道为什么; 它昨天工作正常.我只是将appsettings和connectionstrings更改为部分或资源而不是webapp,以将dependsOn移动到链中.以前,该网站取决于应用程序设置和连接字符串的依赖关系.这是网站资源的ARM模板.
{
"comments": "Primary web app deployment.",
"name": "[variables('webAppName')]",
"type": "Microsoft.Web/sites",
"apiVersion": "2016-08-01",
"kind": "app",
"location": "[variables('rgLocation')]",
"tags": {},
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', variables('planName'))]"
],
"properties": {
"enabled": true,
"hostNameSslStates": [
{
"name": "[concat(variables('webAppName'), '.azurewebsites.net')]",
"sslState": "Disabled"
},
{
"name": "[concat(variables('webAppName'), '.scm.azurewebsites.net')]",
"sslState": "Disabled"
}
],
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('planName'))]",
"siteConfig": {
"numberOfWorkers": 1,
"defaultDocuments": [
"Default.htm",
"Default.html",
"Default.asp",
"index.htm",
"index.html",
"iisstart.htm",
"default.aspx",
"index.php",
"hostingstart.html"
],
"netFrameworkVersion": "v4.6",
"phpVersion": "",
"pythonVersion": "",
"nodeVersion": "",
"linuxFxVersion": "",
"requestTracingEnabled": false,
"remoteDebuggingEnabled": false,
"remoteDebuggingVersion": …Run Code Online (Sandbox Code Playgroud) 使用Azure 资源管理器模板以GlobalDocumentDB模式部署Cosmos Db数据库时,我无法得知在部署期间无法在数据库中配置集合。
在ARM模板部署期间,有任何一种方法可以(按优先顺序排列)
我正在构建一组脚本和模板以在Azure中创建Service Fabric群集。我有一个脚本,该脚本创建密钥库和自签名证书,并将其成功上传到库中。另一个脚本创建了群集,但是在证书链接到虚拟机时出现了错误。该New-AzureRmResourceGroupDeployment命令的错误是:-
{
"status": "Failed",
"error": {
"code": "ResourceDeploymentFailure",
"message": "The resource operation completed with terminal provisioning state 'Failed'.",
"details": [
{
"code": "KeyVaultAccessForbidden",
"message": "Key Vault https://VAULT-NAME.vault.azure.net/secrets/clusterCert/SECRET-ID either has not been enabled for deployment or the vault id provided, /subscriptions/SUBSCRIPTION-ID/resourceGroups/jg-sf/providers/Microsoft.KeyVault/vaults/VAULTNAME, does not match the Key Vault's true resource id."
}
]
}
Run Code Online (Sandbox Code Playgroud)
}
VAULT-NAME,SUBSCRIPTION-ID和SECRET-ID均正确。密钥库已使用参数创建"enabledForTemplateDeployment": true,如以下屏幕截图所示。
我的脚本和模板可以在GitHub- https://github.com/goochjs/azure-testbed中看到。
我如何诊断问题?
谢谢,
杰里米
azure azure-resource-manager azure-service-fabric azure-keyvault azure-template
我创建了几个 Azure API 连接,它允许我更改显示名称,但无法更改名称本身。显然,它会根据连接类型自动创建连接。有没有办法控制这个?
在启用的逻辑应用上部署具有托管标识访问策略的 KeyVault 服务时,它会失败,因为它尚不存在。我确实为逻辑应用程序添加了依赖项。
奇怪的是,这个模板已经工作了数周,现在每次都失败,所以我有点困惑。我从 MS 的快速入门模板复制了这个。但这不是问题,因为如果您查看错误,它会指向正确的目标资源。如果我在失败后单击重新部署,这个模板也可以工作,因为当时托管标识已经存在。我测试了它,无论如何它失败了。
这是我的 ARM 模板
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"logicAppName": {
"type": "string",
"minLength": 1,
"metadata": {
"description": "Describes the name of the Logic App resource"
},
"defaultValue": "demo"
},
"location": {
"type": "string",
"defaultValue": "[resourceGroup().location]",
"metadata": {
"description": "Specifies the Azure location where the key vault should be created."
}
}
},
"variables": {
"keyVaultName": "[concat('eakeyvault', uniquestring(resourceGroup().id))]",
"logicAppName": "[parameters('logicAppName')]"
},
"resources": [
{
"type": "Microsoft.KeyVault/vaults",
"name": "[variables('keyVaultName')]",
"apiVersion": "2018-02-14",
"location": "[parameters('location')]",
"dependsOn": …Run Code Online (Sandbox Code Playgroud) azure azure-resource-manager azure-rm-template azure-managed-identity
我是编写 Azure 资源管理器模板的新手;我需要检索 Azure 存储帐户连接字符串。我可以使用[listKeys(variables('storageAccountId'), '2019-04-01').keys[0].value]where storageAccountIdis检索它的访问密钥,[resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccountName'))]但我无法为连接字符串(主要)这样做。
现在,我的问题是我们有listKeys检索访问密钥的功能,我们是否也有一些系统功能来检索连接字符串?还是我们需要连接并创建连接字符串?我有存储帐户名称和资源组名称的值。我如何使用 ARM 做到这一点?
我有 Azure DevOpe 管道,它工作得很好,但昨天我突然出现了 showstopper 错误。管道没有给出错误,但没有创建 SQL 逻辑服务器。我删除了资源组中的所有资源。然后我再次执行管道。我收到“正在进行的逻辑服务器请求已在进行中,请稍后重试您的请求”错误。我已经 24 小时无法创建逻辑服务器了。
我以为我可以从 Azure 门户取消部署,但我没有看到任何部署有错误。我能做什么?
Azure DevOps 上的错误:
C:\windows\System32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NoProfile -NonInteractive -
ExecutionPolicy Unrestricted -Command ". 'D:\a\_temp\43a1dcab-bbff-4fd8-8cc7-5773945858fa.ps1'"
Import-Module -Name C:\Modules\az_4.3.0\Az.Accounts\1.9.1\Az.Accounts.psd1 -Global
Clear-AzContext -Scope Process
Clear-AzContext -Scope CurrentUser -Force -ErrorAction SilentlyContinue
Connect-AzAccount -ServicePrincipal -Tenant *** -Credential System.Management.Automation.PSCredential
-Environment AzureCloud @processScope
Set-AzContext -SubscriptionId 0000000000000000000 -TenantId ***
strtempdigiopsdev
##[error]9:15:12 AM - The deployment 'TemplateMasterDeployment' failed with error(s). Showing 2 out
of 2 error(s).
Status Message: The resource operation completed with terminal provisioning state 'Failed'. …Run Code Online (Sandbox Code Playgroud) 使用 terraform 很长时间后,我决定开始学习 azure bicep。到目前为止,我正在努力掌握逻辑。到目前为止,我已经尝试了存储帐户和密钥库的部署。我在这里所做的事情如下。
这正如我所期望的那样。
所以我想向前迈出一步。这就是我有点困惑的地方。
我想做的是使用相同的二头肌模板来创建一个新的秘密,但在不同的资源组中创建到不同的密钥保管库中。
现在,根据我对 azure 文档的理解,该模板带有默认值scope,在我的具体情况下,它以我的默认订阅为目标,并从终端运行我的二头肌模板,我使用命令
az deployment group create -f ./template.bicep -g <resource-group-name>
Run Code Online (Sandbox Code Playgroud)
这是我的模板:
// Default values I'm using to test
param keyVaultName string = '<keyvault-name>'
param managedIdentityName string = 'test-managed-identity'
param tenantCodes array = [
'elhm'
'feor'
]
// I'm using prefix so I dont need to create additional arrays
var keyVaultKeyPrefix = 'Client-Key-'
var storagePrefix = 'sthrideveur'
// Get a reference to key vault
resource keyVault 'Microsoft.KeyVault/vaults@2021-06-01-preview' …Run Code Online (Sandbox Code Playgroud)