Edit

Share via


Quickstart: Add resources or resource containers to service groups with Service Group Member Relationships

To add resources, resource groups, or subscriptions to a Service Group (preview), you need to create a new Service Group Member Relationship. 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.

  • To be able to deploy a service group member relationship, you must have Microsoft.Relationship/ServiceGroupMember/write permissions on the source as well as Microsoft.ServiceGroup Contributor at the target service group.

Create in REST API

For REST API, use the Service Groups Member- Create or Update endpoint to create a new service group member.

In this example, we're adding a Virtual Machine [VM1] to a service group [Contoso].

  1. Service Group: groupId is Contoso
  2. Virtual Machine: The resourceID is VM1
  3. Service Group Member: The relationshipID is SGM1

When you're adding a resource to a service group, you create service group member by extending the resource.

  • REST API URI

    PUT https://management.azure.com/[scope]/providers/Microsoft.Relationships/serviceGroupMember/SGM1?api-version=2023-09-01-preview
    

In the preceding example, the new service group member is created extending the Virtual Machine. To specify the service group as the parent, use the TargetID property.

  • REST API URI

    PUT https://management.azure.com/subscriptions/[SUBID]/resourceGroups/[RGID]/providers/microsoft.compute/virtualmachine/[VMID]/providers/Microsoft.Relationships/serviceGroupMember/SGM1?api-version=2023-09-01-preview
    
  • Request Body

      {
        "properties": {
         "targetId": "providers/microsoft.management/servicegroups/Contoso"
        }
      }
    

Clean up resources

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

  • REST API URI

    DELETE https://management.azure.com/[scope]/providers/Microsoft.Relationships/serviceGroupMember/SGM1?api-version=2023-09-01-preview
    
  • No Request Body

Next step

In this quickstart, you created a service group to help create different views in Azure. The service group can have member subscriptions, resource groups, resources, or other service groups.

To learn more about service groups and how to manage your service group hierarchy, continue to: