Home > database >  Backing up and Deploying a Resource Group in Azure using ARM
Backing up and Deploying a Resource Group in Azure using ARM

Time:11-12

We have an Azure Resource Group that has been used for testing that has 7 resources including a SQL Server and SQL Database among other things. We no longer use the Resource Group, but it took a long time to set up and configure, so we want to back it up for easier deployment if we need it again.

To do this, we have decided to export it to an ARM template from the resource group so we can keep as much of the configuration as possible. After exporting, I wanted to deploy the ARM template to make sure that it worked before deleting the original resource group.

I created a new test resource group, and added required tags. I then went to Deploy a custom template, and pasted the generated ARM script with no changes, and selected the resource group that I had just made. I clicked deploy, and got more than 200 errors, most of them being Not Found errors.

Example:

{
    "status": "Failed",
    "error": {
        "code": "ParentResourceNotFound",
        "message": "Can not perform requested operation on nested resource. Parent resource 'test5-db/dddd-DEV' not found."
    }
}

The database is in the ARM template though:

    {
        "type": "Microsoft.Sql/servers",
        "apiVersion": "2022-02-01-preview",
        "name": "[parameters('servers_dev_db_name')]",
        "location": "westus2",
        "tags": {
            ...
        },
        "kind": "v12.0",
        "properties": {
            "administratorLogin": "*****",
            "version": "12.0",
            "minimalTlsVersion": "1.2",
            "publicNetworkAccess": "Enabled",
            "restrictOutboundNetworkAccess": "Disabled"
        }
    },

The servers_dev_db_name does match the resource name in the error, with the frontdoor name attached after the / (ie. "[parameters('servers_dev_db_name')]"/dddd-DEV )

Since I am unable to share my ARM file, I realize that no specific advice can be given. However, if there is some obvious thing that I did wrong, or an obvious setting I would need to change since I am deploying to a resource group with a different name, I would greatly welcome the advice. This is my first time working with Azure.

CodePudding user response:

The issue for SQL turned out to be that I was missing an administratorLoginPassword for SQL, which was required. It appears that this does not get exported in ARM, which makes sense, but it would have been nice if there was documentation that said it would need to be added.

There are still deploy issues, but since this post focused on SQL, I'll make a new post for additional questions.

  • Related