标签: azure-resource-group

在VSTS ARM版本中,"其中一个部署参数具有空键"是什么意思

我的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

6
推荐指数
3
解决办法
1433
查看次数

az 标签更新错误:(MissingSubscription)请求没有订阅或有效的租户级资源提供程序

我正在尝试在 Azure 资源组上设置名为“GitBranch”的标签:

Azure 门户

当我在 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)

然后它就起作用了:

PowerShell 窗口

但是当我在 Git Bash 窗口中尝试相同的命令时,它失败了。

我之前也尝试过调用以下命令,并且还尝试过双引号和单引号

az login
az account set --subscription "79ca5b....7f"
Run Code Online (Sandbox Code Playgroud)

但错误仍然是一样的:

错误:(MissingSubscription)请求没有订阅或有效的租户级资源提供程序。

Git Bash 窗口

我尝试让该命令在 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)

tags azure azure-cli azure-resource-group azure-pipelines

6
推荐指数
1
解决办法
3613
查看次数

运行构建步骤 Azure 资源组部署时 StorageAccountAlreadyExists

我正在尝试让我的构建定义\xc2\xa0将\xc2\xa0所有必要的资源(SQL Server、数据库、Web应用程序和存储帐户)部署到azure,并在重新部署时进行更新。我使用 Visual Studio Team Services VSTS / TFS。构建步骤“Azure 资源组部署”失败\xc2\xa0,并出现错误:

\n\n
\n
"code": "StorageAccountAlreadyExists",\n"message": "The storage account named mystorageaccountname already exists under the subscription."\n
Run Code Online (Sandbox Code Playgroud)\n
\n\n

嗯,\xc2\xa0storage 帐户 mystorageaccountname 确实已经存在,但这是\xc2\xa0 尝试实现持续交付和重新部署时通常的情况。我想重用现有帐户。

\n\n

对于其他资源,例如 SQL 服务器和 SQL 数据库,资源的预先存在不是问题。

\n\n

如何进行可反复使用\xc2\xa0 的 Azure 资源组部署?

\n

continuous-integration continuous-deployment azure-resource-manager azure-resource-group

5
推荐指数
1
解决办法
1884
查看次数

从 Azure 资源管理器模板中的资源组获取标签

从定义了名为 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

5
推荐指数
1
解决办法
3632
查看次数

将Azure Resource Group项目部署为MsBuild脚本的一部分

我正在尝试将我们的解决方案从经典迁移到资源管理器部署,并且我坚持运行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文件名和模板文件名).

msbuild azure-resource-group

5
推荐指数
0
解决办法
108
查看次数

Azure 资源创建者和时间戳

我们有具有 3 个不同订阅的 Azure 环境,并且在此环境中部署了大约 5 个项目资源。

每个项目团队都有权在 Azure 中的特定资源组 (RG) 下创建资源。

现在从 Azure 管理员的角度来看,我想知道谁、何时

这是任何组织跟踪其成本、资源信息的基本要求。当我查看 Azure 时,此信息无法直接在资源级别获得。

很少有帖子提到为此使用标记或使用日志(2年前,真的吗?)?是吗?我很惊讶。

我可以为此使用 Application Insight 吗?或者仅适用于应用程序服务类型的服务?

请帮助我有效地获取此信息

azure event-tracking azure-resource-group

5
推荐指数
1
解决办法
6829
查看次数

Azure 资源组组织

我意识到对此可能没有单一的答案,但我很好奇是否有任何公认的最佳实践或关于如何组织资源组和订阅的共识。

假设您有很多环境,例如开发、测试、登台和生产。而你的产品是由N个服务、数据库等组成的。我想到了两个想法:

  1. 每个环境的订阅:为每个环境使用不同的订阅,并为环境中的不同子系统创建资源组。我面临的挑战是如何组织事物并不总是显而易见的。假设您有两个通过服务总线进行通信的子系统。服务总线本身属于哪个资源组?增加粒度是一个不错的选择,但在实践中我很少使用。
  2. 每个环境的资源组:在所有环境中共享相同的订阅,并使用资源组将所有内容分组在一起。因此,您有一个开发资源组、测试资源组等等。这不会提供大量的粒度,但正如我所说,在我看来,增加的粒度本身就会带来问题。

不管怎样,我只是好奇对此是否有任何共识或只是想法。干杯!

azure azure-resource-group

5
推荐指数
1
解决办法
2705
查看次数

现有 Linux ASP 的资源组不支持机器人服务 Web 应用程序

尝试创建托管在 Web 应用程序上的机器人服务时,在尝试部署到存在现有 Linux 应用程序服务计划的资源组时遇到错误。我并没有尝试在该 ASP 上托管我的 Bot 服务,只是尝试为 Bot 服务部署新的 ASP,但出现以下错误:

在此输入图像描述

考虑到资源组设计,如果我想要任何机器人服务 Web 应用程序,我是否无法将它们部署在具有 Linux ASP 的资源组中?

botframework azure-resource-group

5
推荐指数
1
解决办法
591
查看次数

ARM 模板部署失败 BadRequest

我正在通过资源组中的 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

5
推荐指数
1
解决办法
9423
查看次数

术语“New-AzResourceGroupDeployment”未被识别为 cmdlet、函数的名称

我需要在我的 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)

powershell azure azure-resource-group

4
推荐指数
2
解决办法
5865
查看次数