Advanced data security setup through ARM template.

Dan 176 Reputation points
2020-06-18T14:44:22.61+00:00

Hi,
I am attempting to create an ARM template for a SQL server deployment, I nearly have it working exactly as I like but I am coming across an issue with the managed identity.

I am able to successfully create a managed identity for the SQL server and then assign a role onto a storage account required for advanced data security, but even though the deployment has a dependency on the role being created, it still fails when trying to setup advanced data security as it complains that the managed identity does not have the correct permissions.

If I wait a minute and then re-run the deployment then it completed successfully.

It seems as though there is a delay between the role being assigned and the assignment actually being available.

Has anyone else seen this type of behaviour or have any idea how I can work around it?

Thanks!

Azure SQL Database
{count} votes

2 answers

Sort by: Most helpful
  1. Mike Ubezzi 2,776 Reputation points
    2020-06-25T03:41:03.633+00:00

    Hi @probi,
    Through the use of deployment order and conditional deployment statements in the ARM deployment, you should be able to execute a deployment without dependency errors. In the case there is an issue, you can handle it more gracefully. Please see: Rollback on error to successful deployment. For general deployment troubleshooting, please see: Debugging ARM template deployments

    0 comments No comments

  2. Balou 1 Reputation point
    2020-07-13T11:24:22.297+00:00

    Hi @probi,
    Would it be possible for you to share the ARM template you created?
    I'm trying to achieve the same but I'm struggling with the ARM template.

    Many thanks

    0 comments No comments