Indeterminable error when deploying ARM templates via Azure DevOps VSTS - azure

An ARM template is being deployed via a Azure Resource Deployment task in Azure Devops (VSTS) Release Management. All resources seem to get created successfully as far as I can see, however there are a few errors which cause the pipeline to fail.
2018-09-12T18:13:39.9155529Z ##[error]Details:
2018-09-12T18:13:39.9156550Z ##[error]BadRequest: {
"code": "BadRequest",
"message": "{\"code\":\"BadRequest\",\"message\":\"Bad Request\",\"innererror\":{\"diagnosticcontext\":\"ef9a7ad4-440f-4786-b1dc-5cbfdee6a964\",\"time\":\"2018-09-12T18:05:15.9905958Z\"}}"
} undefined
It is difficult to see which resource in the ARM template causes this. Can anyone point out anything which might help determine the cause of the problem?

Related

Azure pipeline Release pipeline: ARM Template deployment: Resource Group scope fails with ,,Error code: DeploymentFailed"

The ARM template seems fine, no validation errors occur, and variables seem to be defined, not sure how should I debug this weird error message.
2023-01-25T16:46:49.4710207Z ==============================================================================
2023-01-25T16:46:49.4710434Z Task : ARM template deployment
2023-01-25T16:46:49.4710576Z Description : Deploy an Azure Resource Manager (ARM) template to all the deployment scopes
2023-01-25T16:46:49.4710814Z Version : 3.210.1
2023-01-25T16:46:49.4710932Z Author : Microsoft Corporation
2023-01-25T16:46:49.4711075Z Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/deploy/azure-resource-group-deployment
2023-01-25T16:46:49.4711307Z ==============================================================================
2023-01-25T16:46:49.6711981Z ARM Service Connection deployment scope - Subscription
2023-01-25T16:46:49.6897349Z Checking if the following resource group exists: APP-RG-DEV-NE.
2023-01-25T16:46:49.9703739Z Resource group exists: true.
2023-01-25T16:46:49.9707493Z Creating deployment parameters.
2023-01-25T16:46:50.7941256Z Starting template validation.
2023-01-25T16:46:50.8120966Z Deployment name is azuredeploy-20230125-164650-9976
2023-01-25T16:46:55.8082119Z Template deployment validation was completed successfully.
2023-01-25T16:46:55.8082485Z Starting Deployment.
2023-01-25T16:46:55.8083063Z Deployment name is azuredeploy-20230125-164650-9976
2023-01-25T16:48:05.5609488Z There were errors in your deployment. Error code: DeploymentFailed.
2023-01-25T16:48:05.5641699Z ##[error]At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/DeployOperations for usage details.
2023-01-25T16:48:05.5651004Z ##[error]Details:
2023-01-25T16:48:05.5651895Z ##[error]BadRequest:
2023-01-25T16:48:05.5652688Z ##[error]BadRequest:
2023-01-25T16:48:05.5653453Z ##[error]BadRequest:
2023-01-25T16:48:05.5654221Z ##[error]BadRequest:
2023-01-25T16:48:05.5654988Z ##[error]BadRequest:
2023-01-25T16:48:05.5656695Z ##[error]Check out the troubleshooting guide to see if your issue is addressed: https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/deploy/azure-resource-group-deployment?view=azure-devops#troubleshooting
2023-01-25T16:48:05.5658246Z ##[error]Task failed while creating or updating the template deployment.
2023-01-25T16:48:05.5682468Z ##[section]Finishing: ARM Template deployment: Resource Group scope
```
Ok found the issue, which was pretty stupid not sure why the error message was not clearer about name violations.
The secret name for the key vault contained a dot (.) in it and was failing because of it.

ARM Template error code invalidTemplate "Circular Dependancy Detected

I am new to deploying ARM templates. Before I created the ARM template I created a simple infrastructure consisting of 1 VM, 1 VNet, and 1 storage account. Once I finished provisioning the infrastructure, I decided to make a template for future use. I went under automation scripts, and I saved it to the library and I saved the changes and then I decided to test it out by deploying the template. After this, I got an error code that says the following:
Deployment template validation failed: 'Circular dependency detected on resource: '/subscriptions/7b790d29-944d-4f0f-861b-928e4774cde9/resourceGroups/SimpleRev2/providers/Microsoft.Network/networkInterfaces/simplevm18'. Please see https://aka.ms/arm-template/#resources for usage details.'. (Code: InvalidTemplate)
So what should i do please guide?

Unable to deploy VMSS in combination to ARM deployment

I hope somebody can guide me with this issue. I do not have issues deploying resources via the web interface. This time I am trying to automatize my infrastructure and I am deploying via ARM. All the resources for the Service Fabric cluster I am trying to create are deployed with no issue, except for the VMSS which throws me this error:
{
"status": "Failed",
"error": {
"code": "LinkedAuthorizationFailed",
"message": "The client has permission to perform action 'Microsoft.KeyVault/vaults/deploy/action' on scope '/subscriptions/xxxxxx/resourcegroups/AllyStage-v2/providers/Microsoft.Compute/virtualMachineScaleSets/StageNode', however the linked subscription 'xxxxx' was not found. "
}
}
Thanks.
It would have helped to look at the ARM template that you're trying to deploy. However, I suspect the problem is that the resource ID for a resource or subscription isn't resolving correctly. Here is a similar issue from the past.
Also, if you are deploying the ARM template from within another bash/PowerShell script, I suggest you ensure that you have the correct context/subscription set before initiating the template deployment, and verify the scope of permissions of the principal performing the deployment.

Arm template validation fails through Azure Devops release, works from powershell and test-AzResourceGroupDeployment

I have a release setup that I'm trying get out through Azure Devops release pipelines. This is based on another release that I've cloned and works fine.
The issue is that the template is failing a validation check and not going any further. Strange thing is i'm able to check the syntax successfully with new-AzResourceGroupDeployment and test-AzResourceGroupDeployment. It reports no errors and has been deploying fine.
Using Azure Devops release the error coming back is:
2020-02-26T12:26:16.2632844Z ==============================================================================
2020-02-26T12:26:16.2633634Z Task : ARM template deployment
2020-02-26T12:26:16.2634204Z Description : Deploy an Azure Resource Manager (ARM) template to all the deployment scopes
2020-02-26T12:26:16.2634534Z Version : 3.1.19
2020-02-26T12:26:16.2634945Z Author : Microsoft Corporation
2020-02-26T12:26:16.2635504Z Help : https://learn.microsoft.com/azure/devops/pipelines/tasks/deploy/azure-resource-group-deployment
2020-02-26T12:26:16.2635948Z ==============================================================================
2020-02-26T12:26:16.8677026Z ARM Service Conection deployment scope - Subscription
2020-02-26T12:26:16.8760315Z Checking if the following resource group exists: myResourceGroup.
2020-02-26T12:26:17.2234188Z Resource group exists: true.
2020-02-26T12:26:17.2259290Z Creating deployment parameters.
2020-02-26T12:26:17.2558066Z The detected encoding for file 'd:\a\r1\a\_Azure-Infrastructure\myResourceGroup\deployment\azuredeploy.json' is 'utf-8'
2020-02-26T12:26:17.2561303Z The detected encoding for file 'd:\a\r1\a\_Azure-Infrastructure\myResourceGroup\deployment\param.dev.json' is 'utf-8'
2020-02-26T12:26:17.5304032Z Starting template validation.
2020-02-26T12:26:17.5304834Z Deployment name is Release-vstfs:///ReleaseManagement/Release/95
2020-02-26T12:26:17.5877973Z ##[warning]Validation errors were found in the Azure Resource Manager template. This can potentially cause template deployment to fail. Template validation failed. Error: {"message":"No HTTP resource was found that matches the request URI 'https://management.azure.com/subscriptions/mySubscription/resourcegroups/myResourceGroup/providers/Microsoft.Resources/deployments/Release-vstfs:/ReleaseManagement/Release/95/validate?api-version=2017-05-10'."}.. Please follow https://learn.microsoft.com/en-us/azure/azure-resource-manager/templates/template-syntax
2020-02-26T12:26:17.5890527Z Starting Deployment.
2020-02-26T12:26:17.5891348Z Deployment name is Release-vstfs:///ReleaseManagement/Release/95
2020-02-26T12:26:17.6289831Z There were errors in your deployment. Error code: undefined.
2020-02-26T12:26:17.6291819Z ##[error][object Object]
2020-02-26T12:26:17.6295387Z ##[error]Task failed while creating or updating the template deployment.
2020-02-26T12:26:17.6399260Z ##[section]Finishing: ARM Template deployment: Resource Group scope
​Looking the log above, I'm not sure if it's failing on the validation errors or on the error near the end with a undefined error code.
The task is from another subscription and it's listed in the Azure Resource Manager connection on the task and also lists the subscription and the resource groups in the subscription.
Anyone any ideas on how I can get this working or where to start troubleshooting?
your deployment name is:
Release-vstfs:/ReleaseManagement/Release/95
fairly certain that's not allowed (/). so you need to set your deployment name to something reasonable.
ps. : might not be allowed as well
Did you look at the Activity Log in Azure portal?
All deployment attempts are logged here. Look in particular at the JSON pane, often the real issue is only displayed here.
Otherwise, if it doesn't reach Azure, can you double check the service connection in Azure DevOps? (in particular the related user permission in Azure)

How to update queue/topic of Azure Service Bus via ARM?

I have a ARM (Azure Resource Manager) script that creates Service bus with topic and subscriber inside. It worked perfectly for some time, but I decided to enable session on topic and disable partitioning. Script was changed and during deployment it gives me:
Template deployment returned the following errors:
07:56:00 - Resource Microsoft.ServiceBus/namespaces/topics 'ops-ServiceBus/default-topic' failed with message '{
"error": {
"message": "SubCode=40000. Partitioning cannot be changed for Topic. . TrackingId:<some_guid>_M11CH3_M11CH3_G1, SystemTracker:ops-servicebus.servicebus.windows.net:default-topic, Timestamp:2019-03-28T04:55:56 CorrelationId: <some_guid>",
"code": "BadRequest"
}
}'
07:56:21 - Template output evaluation skipped: at least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-debug for usage details.
Is it possible to perform update operation on Queue/Topic using ARM?
We did configure queues\topics with arm templates, but according to the error - some parameters are immutable, so you'd have to recreate in this case.

Resources