azure-resource-manager

How can I troubleshoot Azure ARM template validation errors?

走远了吗. 提交于 2021-02-06 09:38:30
问题 I have made some small changes to an Azure ARM template file and now when I try to deploy or validate via the xplat cli I get this message. error: InvalidTemplateDeployment : The template deployment 'fakedDeploymentName' is not valid according to the validation procedure. The tracking id is '\some kind of GUID here\'. See inner errors for details. Please see http://aka.ms/arm-deploy for usage details. error: PreflightValidationCheckFailed : Preflight validation failed. Please refer to the

Azure Resource Manager template chained functions

强颜欢笑 提交于 2021-02-05 11:30:12
问题 I am trying to remove / from the URL using azure function before assigning to output variable value "webappStorageUri":{ "type": "string", "value": "[take(reference(resourceId('Microsoft.Storage/storageAccounts', variables('webappStorageName'))).primaryEndpoints.web, length(reference(resourceId('Microsoft.Storage/storageAccounts', variables('webappStorageName'))).primaryEndpoints.web)-1]" } Returned value from length function should be the value for take function. This is not working. I get

Create API Connection for Azure Data Factory with service principal authentication using ARM Template

爱⌒轻易说出口 提交于 2021-01-29 13:18:26
问题 I've created a logic app that uses azure data factory connectors. I can create the API Connection with service principal authentication from the portal: But I can't find any documentation on how to create an API connection using ARM template. But I need to create using ARM template with the same service principal authentication. 回答1: You can create an API connection for Azure Data factory using ARM template like that: { "$schema": "https://schema.management.azure.com/schemas/2015-01-01

Adding a Key Vault Access Policy to an Existing Key Vault via ARM

℡╲_俬逩灬. 提交于 2021-01-29 08:58:18
问题 I am trying to do an ARM deployment in Azure Devops whereby I add a key vault access policy to an existing key vault in Azure. I want to use the following ARM template which adds an access policy to an existing Key Vault: https://github.com/Azure/azure-quickstart-templates/tree/master/101-keyvault-add-access-policy I have a separate template that deploys an App service and creates a system assigned managed identity. What is the best way to link the two templates? how do i reference the System

Passing parameter to script from Invoke-AzVMRunCommand

半城伤御伤魂 提交于 2021-01-29 05:18:35
问题 I trying to execute the Invoke-AzVMRunCommand to execute a PS function that accept parameters. The code below shows call to the Invoke-AzVMRunCommand $runcmdparameters=@{ "VolumeLable"="sdsd"; "azurelun"="1,3,4" } Invoke-AzVMRunCommand -ResourceGroupName $ServerResourceGroupName -VMName $VMVame -ScriptPath "c:\Configurestorage.ps1" -CommandId 'RunPowerShellScript' -Parameter $runcmdparameters -Verbose The PS Script that I need to execute on the server is function Configure-Storage { Param(

Getting issues while assigning reader role to storage account via ARM template

自闭症网瘾萝莉.ら 提交于 2021-01-28 14:12:28
问题 I am facing following error "The request to create role assignment 'c*****************5' is not valid. Role assignment scope '/subscriptions/c**********************5/resourceGroups/MyResourceGroup/providers/Microsoft.Storage/storageAccounts/mystorageaccountname' must match the scope specified on the URI" { "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "parameters": { "principalId": { "type": "string", "defaultValue":

Get current subscription id in parameter file

懵懂的女人 提交于 2021-01-28 05:19:03
问题 I have such a azuredeploy.parameters.json file: { "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", "contentVersion": "1.0.0.0", "parameters": { "adminLogin": { "value": "exampleadmin" }, "adminPassword": { "reference": { "keyVault": { "id": "/subscriptions/[subscription().subscriptionId]/resourceGroups/ARMTemplate/providers/Microsoft.KeyVault/vaults/dev-kv" }, "secretName": "ExamplePassword" } }, "sqlServerName": { "value": "TestServer" } } } My

Azure Windows VM - how can I find out what Resource Group it is in?

妖精的绣舞 提交于 2021-01-28 04:27:56
问题 I have C# code running on an Azure Windows VM. Is there a way for me to find out what Resource Group this VM is in? VM has been deployed with Azure Resource Management API (new, not classic) 回答1: The following will guarantee the ability to distinguish between vm's with the same name across different resource groups: From your C# code, find the vmId (involves running one of the commands at the following link or possibly using an Azure SDK: https://azure.microsoft.com/en-us/blog/accessing-and

Azure ARM templates : DocumentDB primaryMasterKey as OUTPUT

一曲冷凌霜 提交于 2021-01-27 13:46:11
问题 In a Azure ARM templates I'm having some problems trying to extract in the OUTPUT section the 'primaryMasterKey' of a DocumentDB created in the RESOURCES section. The deploy reports this error : The template output 'documentDbPrimaryMasterKey' is not valid: Index (zero based) must be greater than or equal to zero and less than the size of the argument list.. (Code: DeploymentOutputEvaluationFailed) The definition of that OUTPUT is : "documentDbPrimaryMasterKey": { "type": "object", "value": "

Azure Active Directory B2C deployment via resource manager (or code)

你说的曾经没有我的故事 提交于 2021-01-02 05:20:27
问题 Our company is considering using AAD B2C as the backing store for our SaaS user accounts. Our plan is use Resource Manager templates to deploy the Azure infrastructure (web, storage, sql, etc) for each client. AAD B2C will be part of that if this works out, but as of now there doesn't appear to be a way to include AAD B2C in resource manager templates. My view of the intent of the B2C product is that it serves as a replacement for the auth and user store components of an app, and should