Edit

Share via


Quickstart: Create a service group (preview) with REST API

With Azure Service Groups (preview) you can create low-privilege-based groupings of resources across subscriptions. They provide a way to manage resources with minimal permissions, ensuring that resources can be grouped and managed without granting excessive access. Service Groups are designed to complement existing organizational structures like Resource Groups, Subscriptions, and Management Groups by offering a flexible and secure way to aggregate resources for specific purposes. For more information on service groups, see Getting started with Service Groups.

Important

Azure Service Groups is currently in PREVIEW. For more information about participating in the preview, see Azure Service Groups Preview. See the Supplemental Terms of Use for Microsoft Azure Previews for legal terms that apply to Azure features that are in beta, preview, or otherwise not yet released into general availability.

Prerequisites

  • If you don't have an Azure subscription, create a free account before you begin.

  • If you haven't already, install ARMClient. It's a tool that sends HTTP requests to Azure Resource Manager-based REST APIs.

Create in REST API

In this example, the service group groupId is Contoso.

  • REST API URI

    PUT https://management.azure.com/providers/Microsoft.Management/serviceGroups/Contoso?api-version=2024-02-01-preview
    
  • Request Body

The groupId is a unique identifier being created. This ID is used by other commands to reference this group and it can't be changed later.

If you want the service group to show a different name within the Azure portal, add the properties.displayName property in the request body. For example, to create a service group with the groupId of Contoso and the display name of Contoso Group, use the following endpoint and request body:

{
  "properties": {
    "displayName": "_Contoso Group_",
    "parent": {
      "resourceId": "/providers/Microsoft.Management/serviceGroups/[tenantId]"
    }
  }
}

In the preceding examples, the new service group is created under the root service group. To specify a different service group as the parent, use the properties.parent.resourceId property.

  • REST API URI

    PUT https://management.azure.com/providers/Microsoft.Management/serviceGroups/Contoso?api-version=2024-02-01-preview
    
  • Request Body

    {
      "properties": {
        "displayName": "Contoso Group",
        "parent": {
          "resourceId": "/providers/Microsoft.Management/serviceGroups/HoldingGroup"
        }
      }
    }
    

Verify your Service Group was created

Service Groups PUT or create call is an Asynchronous call which means that the response to the initial create call is that it was accepted. This response doesn't mean the service group was successfully created, only that the Azure successfully received the request to create the service group.

To check the operation was successful, you should do a GET call on the value returned in the azure-asyncoperation header. The URL provides the status of the created operation.

Note

To avoid issues within scripts or templates, the automation should poll this provided URL before moving to the next step. If the automation moves to the next step before the operation has responded successfully, the next operation will fail as the service group has not been created.

Clean up resources

To remove the service group created in this document, use the Service Group Delete endpoint:

  • REST API URI

    DELETE https://management.azure.com/providers/Microsoft.Management/serviceGroups/Contoso?api-version=2024-02-01-preview
    
  • No Request Body