我的ARM模板资源组部署在VSTS中失败.
我得到一个错误,没有任何具体问题的参数参考:"其中一个部署参数有一个空键.详情请参阅https://aka.ms/arm-deploy/#parameter-file."
引用的url包含一般信息,一条注释询问相同的问题,但没有答案.有人要求它避免它可能与部署步骤(2.*)的版本有关,而且它不再使用Powershell.我通过模板来回比较BeyondCompare中的参数,没有任何内容......
有谁知道这个错误意味着什么?
deployment parameters azure-resource-manager azure-pipelines-build-task azure-resource-group
我正在尝试在 Azure 资源组上设置名为“GitBranch”的标签:
当我在 PowerShell 窗口中调用命令时 -
az tag update --resource-id "/subscriptions/79ca5b...7f/resourceGroups/ccg-afarber2" --subscription "79ca5b...7f" --operation merge --tags GitBranch=Test
Run Code Online (Sandbox Code Playgroud)
然后它就起作用了:
但是当我在 Git Bash 窗口中尝试相同的命令时,它失败了。
我之前也尝试过调用以下命令,并且还尝试过双引号和单引号
az login
az account set --subscription "79ca5b....7f"
Run Code Online (Sandbox Code Playgroud)
但错误仍然是一样的:
错误:(MissingSubscription)请求没有订阅或有效的租户级资源提供程序。
我尝试让该命令在 bash 中工作的原因是因为我的 Azure 管道任务遇到了相同的错误:
- task: AzureCLI@2
displayName: 'Set Resource Group tag'
inputs:
azureSubscription: '${{ parameters.ArmConnection }}'
scriptType: 'bash'
scriptLocation: 'inlineScript'
inlineScript: |
az tag update \
--resource-id '/subscriptions/${{ parameters.SubscriptionId }}/resourceGroups/${{ parameters.ResourceGroupName }}' \
--subscription '${{ parameters.SubscriptionId }}' \
--operation Merge --tags \
GitBranch=$(git branch --show-current) …Run Code Online (Sandbox Code Playgroud) 我正在尝试让我的构建定义\xc2\xa0将\xc2\xa0所有必要的资源(SQL Server、数据库、Web应用程序和存储帐户)部署到azure,并在重新部署时进行更新。我使用 Visual Studio Team Services VSTS / TFS。构建步骤“Azure 资源组部署”失败\xc2\xa0,并出现错误:
\n\n\n\n\nRun Code Online (Sandbox Code Playgroud)\n"code": "StorageAccountAlreadyExists",\n"message": "The storage account named mystorageaccountname already exists under the subscription."\n
嗯,\xc2\xa0storage 帐户 mystorageaccountname 确实已经存在,但这是\xc2\xa0 尝试实现持续交付和重新部署时通常的情况。我想重用现有帐户。
\n\n对于其他资源,例如 SQL 服务器和 SQL 数据库,资源的预先存在不是问题。
\n\n如何进行可反复使用\xc2\xa0 的 Azure 资源组部署?
\ncontinuous-integration continuous-deployment azure-resource-manager azure-resource-group
从定义了名为 name 的标签的资源组tag1(通过门户完成),我在 Visual Studio 中拥有以下部署模板:
{
"name": "appsettings",
"type": "config",
"apiVersion": "2015-08-01",
"dependsOn": [
"[resourceId('Microsoft.Web/sites', variables('websiteName'))]"
],
"tags": {
"displayName": "website AppSettings"
},
"properties": {
"Setting1": "[resourceGroup().tags.tag1]",
"Setting2": "[parameters('param2')]"
}
}
Run Code Online (Sandbox Code Playgroud)
我收到这个错误:
...'语言表达式属性'tags'不存在,可用属性为'id、name、location、properties'...
但是使用https://resources.azure.com我可以看到资源组tag确实具有以下属性:
{
"id": "/subscriptions/{someguid}/resourceGroups/resourceGroup1",
"name": "resourceGroup1",
"location": "brazilsouth",
"tags": {
"tag1": "test"
},
"properties": {
"provisioningState": "Succeeded"
}
}
Run Code Online (Sandbox Code Playgroud)
有没有办法获取部署模板中的资源组标签?
正如 @juvchan 指出的,标签必须存在,否则会发生此错误。我创建了标签,但是从 VisualStudio 部署模板时,标签被删除,从门户部署时,标签被保留。这导致了不同的问题。
原因是 Visual Studio 项目有一个包含以下行的 PowerShell 脚本:
#Create or update the resource group using the …Run Code Online (Sandbox Code Playgroud) azure azure-resource-manager azure-rm-template azure-resource-group
我正在尝试将我们的解决方案从经典迁移到资源管理器部署,并且我坚持运行RM部署作为MsBuild构建脚本的一步.对于经典项目有
<MSBuild Projects="SomeAzureProject\SomeAzureProject.ccproj"
Targets="Publish"
Properties="
VisualStudioVersion=$(VisualStudioVersion);
Configuration=$(CloudConfiguration);
Platform=$(Platform);
TargetProfile=$(CloudTargetProfile);
PublishProfile=$(CloudPublishProfile);
PublishDir=$(CloudPublishDir);"></MSBuild>
Run Code Online (Sandbox Code Playgroud)
建立步骤.
.deployproj有这样的东西吗?如果是 - 应该将哪些参数传递给它?(我们需要能够至少传递资源组名称,params文件名和模板文件名).
我们有具有 3 个不同订阅的 Azure 环境,并且在此环境中部署了大约 5 个项目资源。
每个项目团队都有权在 Azure 中的特定资源组 (RG) 下创建资源。
现在从 Azure 管理员的角度来看,我想知道谁、何时
这是任何组织跟踪其成本、资源信息的基本要求。当我查看 Azure 时,此信息无法直接在资源级别获得。
很少有帖子提到为此使用标记或使用日志(2年前,真的吗?)?是吗?我很惊讶。
我可以为此使用 Application Insight 吗?或者仅适用于应用程序服务类型的服务?
请帮助我有效地获取此信息
我意识到对此可能没有单一的答案,但我很好奇是否有任何公认的最佳实践或关于如何组织资源组和订阅的共识。
假设您有很多环境,例如开发、测试、登台和生产。而你的产品是由N个服务、数据库等组成的。我想到了两个想法:
不管怎样,我只是好奇对此是否有任何共识或只是想法。干杯!
尝试创建托管在 Web 应用程序上的机器人服务时,在尝试部署到存在现有 Linux 应用程序服务计划的资源组时遇到错误。我并没有尝试在该 ASP 上托管我的 Bot 服务,只是尝试为 Bot 服务部署新的 ASP,但出现以下错误:

考虑到资源组设计,如果我想要任何机器人服务 Web 应用程序,我是否无法将它们部署在具有 Linux ASP 的资源组中?
我正在通过资源组中的 Azure DevOps(ARM 模板部署)任务部署 ARM 模板(Web 应用程序)。执行部署时出现以下错误:
##[section]Starting: ARM Template deployment: Resource Group scope
==============================================================================
Task : ARM template deployment
Description : Deploy an Azure Resource Manager (ARM) template to all the deployment scopes
Version : 3.1.18
Author : Microsoft Corporation
Help : https://learn.microsoft.com/azure/devops/pipelines/tasks/deploy/azure-resource-group-deployment
==============================================================================
ARM Service Conection deployment scope - Subscription
Checking if the following resource group exists: xyz.
Resource group exists: true.
Creating deployment parameters.
Starting template validation.
Deployment name is azuredeploy-xyz
Template deployment validation was completed successfully. …Run Code Online (Sandbox Code Playgroud) azure-resource-manager azure-devops azure-rm-template azure-resource-group azure-webapps
我需要在我的 PowerShell 中运行以下命令:
New-AzResourceGroupDeployment
-Name Myrg1010
-ResourceGroupName ADFcslResourceGroup
-TemplateFile C:\ADFARM.json
-TemplateParameterFile C:\ADFARM-Parameters.json
Run Code Online (Sandbox Code Playgroud)
在运行此命令之前,我已连接到 Azure 订阅
Connect-AzAccount
Run Code Online (Sandbox Code Playgroud)
但我有以下错误:
New-AzResourceGroupDeployment : The term 'New-AzResourceGroupDeployment' is
not recognized as the name of a cmdlet,
function, script file, or operable program. Check the spelling of the name,
or if a path was included, verify that the
path is correct and try again.
At line:1 char:1
+ New-AzResourceGroupDeployment -Name MyARMDeployment -ResourceGroupNam ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (New-
AzResourceGroupDeployment:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : …Run Code Online (Sandbox Code Playgroud) azure ×5
azure-cli ×1
azure-devops ×1
botframework ×1
deployment ×1
msbuild ×1
parameters ×1
powershell ×1
tags ×1