Azure Templates - Failed to save template

Bhargav Patel 26 Reputation points
2021-07-27T04:25:15.89+00:00

Hi all,

I am struggling to save my first Azure Template.
I am trying to add new template from Home > Templates > Add template.
I filled out Name, Description and copied valid JSON template. When I press OK, I get following error message.

Failed to save template.
The client 'live.com#XYZ@Karima ben .com' with object id 'abcd1234-1234-XXXX-b7db-5245401e1234' does not have authorization to perform action 'Microsoft.Gallery/register/action' over scope '/providers/Microsoft.Gallery' or the scope is invalid. If access was recently granted, please refresh your credentials.

I have PAYG Subscription and I am logged in as a Global Administrator. I have also allowed my user an elevated permissions through the Active Directory > Properties > Access management for Azure resources = Yes.

Now, I do not know what is missing, can anyone suggest a solution?

Thanks.
Bhargav

Azure Cost Management
Azure Cost Management
A Microsoft offering that enables tracking of cloud usage and expenditures for Azure and other cloud providers.
2,665 questions
{count} vote

2 answers

Sort by: Most helpful
  1. Bhargav Patel 26 Reputation points
    2021-08-16T06:26:13.847+00:00

    I reached out to Microsoft support as @SadiqhAhmed-MSFT mentioned and I got below response.

    I have checked it and it works on my machine/account :) .

    As per Microsoft there are the 2 mitigations provided by the production team:

    1. Use “template spec” feature instead of “template” feature. The old “template” feature related to gallery is deprecated and will be removed from portal soon. Please check https://learn.microsoft.com/en-us/azure/azure-resource-manager/templates/template-spec-convert for details.
    2. Let the tenant admin create the first gallery template to turn on the ability to create templates for all users under the same tenant.

    I tried Template Spec and it works for me, The creation steps is basically the same as “template” feature.

    • Go to “template spec” in portal
    • Select “Create template spec”
    • Fill in the form and create (note that templates with the same name will be overridden by the latest version)

    Hope this answer helps others too.

    2 people found this answer helpful.

  2. SadiqhAhmed-MSFT 46,036 Reputation points Microsoft Employee
    2021-07-29T14:49:09.933+00:00

    @Bhargav Patel You must have permission to do the /register/action operation for the resource provider. The permission is included in the Contributor and Owner roles. Ref doc: https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/resource-providers-and-types#register-resource-provider

    If you are the Global Administrator of the AAD tenant you can use the steps documented here elevate-access-global-admin to regain access to the subscription. You should then be able to perform to operation to save ARM template.

    ---------------------------------------------------------------------------------------------------------------

    If the response helped, do "Accept Answer" and up-vote it.


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.