Can we block or warn against all deployment attempts initiated via “Deploy to Azure” buttons or external ARM/Bicep templates

Julius Holmberg 6 Reputation points
2025-11-18T07:47:05.02+00:00

Can we block or warn against all deployment attempts initiated via “Deploy to Azure” buttons or external ARM/Bicep templates — without preventing legitimate internal portal usage? Teams should still be able to click and deploy through the Azure portal; we don’t want to block that. But we do want to avoid any one-click deployments or external templates that haven’t been reviewed.


ARM Template: ARM resource definition according to Microsoft-standard JSON
Quickstart Template: Microsoft + community
Custom Template: You/your organization


I’ve looked into how these buttons work. Their functionality is similar to Custom Templates, except they come preloaded with content from a linked source—often GitHub or Microsoft Learn. They are labeled as “Azure Resource Manager template” or “Azure quickstart template” when you use a button.

Examples; Deploy to Azure button - Azure Resource Manager | Microsoft Learn

azure-quickstart-templates/quickstarts/microsoft.storage/storage-account-create at master · Azure/azure-quickstart-templates · GitHub

Can harmful things be deployed here? Yes, but only if our own user is extremely careless and irresponsible.

Risks:

  • Network is opened to the internet
  • Foreign and unknown files are uploaded during resource setup; the file could be hostile or malicious
  • An excessively expensive resource is purchased
  • An unverified third-party resource is deployed

However, there is no significant difference between this method and deploying your own Infrastructure as Code (IaC).

Azure Policy
Azure Policy
An Azure service that is used to implement corporate governance and standards at scale for Azure resources.
{count} votes

1 answer

Sort by: Most helpful
  1. Stanislav Zhelyazkov 29,301 Reputation points MVP Volunteer Moderator
    2025-11-25T13:28:02.0466667+00:00

    Hi,

    This is not the answer you are expecting however is the only answer - it is not possible. Proof:

    Resources that are exempt from policy evaluation The following resource types bypass policy evaluation: Microsoft.Resources/, except resource groups and subscriptions. For example, Microsoft.Resources/deployments and Microsoft.Resources/templateSpecs are not evaluated by policy. Microsoft.Billing/ Microsoft.Capacity/reservationOrders/* Microsoft.Help/* Microsoft.Diagnostics/*

    Source: Official Azure Policy GitHub repository.

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    0 comments No comments

Your answer

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