Upgrade to new version of API

Bas Pruijn 956 Reputation points
2023-12-18T12:36:54.0633333+00:00

As you might know, the API Version 2014-04-01 will be retired by Microsoft. I want to change my ARM templates to use a newer version of the API. However, I run into an issue. I want to set the 'automatic tuning' settings to 'ON/ENABLED'. I can do this via the ARM template using the 2014-04-01 version of the API. See also https://learn.microsoft.com/en-us/azure/templates/microsoft.sql/2014-04-01/servers/advisors?pivots=deployment-language-arm-template

Newer versions of the API do not support this endpoint anymore. They state:

This resource type is read-only, which means it can't be deployed but an existing instance can be referenced. Typically, read-only resource types are automatically created by the service.

I tried exporting a template for an existing database, but that template is still using the depricated API.

How do I set these automatic tuning settings with a supported version of the API? The only thing I could find was https://learn.microsoft.com/en-us/rest/api/sql/database-automatic-tuning/update?view=rest-sql-2021-11-01&tabs=HTTP. This would however require an additional step in my deployment-pipelines to first deploy the server and secondly set the desired automatic tuning values.

I do not see the logic that this functionality is available via the management API, but not via ARM templates.

Azure SQL Database
0 comments No comments
{count} votes

Accepted answer
  1. GeethaThatipatri-MSFT 29,517 Reputation points Microsoft Employee
    2023-12-18T21:04:44.0566667+00:00

    Hi,@Bas Pruijn Thanks for posting your question in the Microsoft Q&A forum.

    Unfortunately, Automatic Tuning never officially supported deployment through ARM template, and it still does not support it.

    https://learn.microsoft.com/en-us/azure/azure-sql/database/automatic-tuning-enable?view=azuresql#:~:text=SQL%20Managed%20Instance.-,Note,ARM%20(Azure%20Resource%20Manager)%20template%20is%20not%20supported%20at%20this%20time.,-Enable%20automatic%20tuning

    User's image

    I don’t see a workaround other than making it a two-step process

    1. Deployment through ARM Template
    2. Setting the Automatic Tuning settings (REST API, Powershell, T-SQL)

    I hope this information helps.

    Regards

    Geetha


1 additional answer

Sort by: Most helpful
  1. Bas Pruijn 956 Reputation points
    2024-01-08T15:05:36.85+00:00

    Hi @GeethaThatipatri-MSFT ,

    I do understand this is formally not supported by the ARM templates. However, when I do generate a template from the Azure Portal it is using the depricated API version to set this setting. Confusing to say the least.....

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.