Skip to content

Instantly share code, notes, and snippets.

@IshamMohamed
Created October 31, 2019 05:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IshamMohamed/850ce4dc0824bec970e275f4efdca1f6 to your computer and use it in GitHub Desktop.
Save IshamMohamed/850ce4dc0824bec970e275f4efdca1f6 to your computer and use it in GitHub Desktop.
cURL command to assign a Blueprint to Azure Management Group
#!/bin/bash
# Below is the cURL command to create or update a Blueprint in Azure
# According to documentation https://docs.microsoft.com/en-us/rest/api/blueprints/assignments/createorupdate,
# the particulat REST endpoint can accept either a subscription or a management group as the scope.
# The below was written to accept a management group
curl 'https://management.azure.com//providers/Microsoft.Management/managementGroups/Kloudynet/providers/Microsoft.Blueprint/blueprintAssignments/assignForMgmtGrp?api-version=2018-11-01-preview' -X PUT -H 'Authorization: Bearer [TOKEN]' -H 'DNT: 1' -H 'Content-Type: application/json' --data-binary $'{\n\u0009identity: {"type" : "SystemAssigned"},\n\u0009location: "southeastasia",\n\u0009properties:{"blueprintId":"providers/Microsoft.Management/managementGroups/Kloudynet/providers/Microsoft.Blueprint/blueprints/BP1", "parameters":{}, "resourceGroups":{}}\n}' --compressed
# But this throws a 404 HTTP response
# Error message - The requested resource was not found, is not supported at the requested scope, or an unsupported HTTP verb was used.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment