title: Azure Event Grid Subscriptions on custom topic in different resource group
body: <p>I am trying to subscribe to a custom event grid topic that exists on a different resource group. For example if I have a custom event grid topic <code>my-custom-topic</code> in a resource group <code>publisher-group</code>. How do I create an event grid subscription to my topic from within the resource group <code>subscriber-group</code>?</p>
  
  <p>The following ARM template only works if the <code>my-custom-topic</code> is in the same resource group that I am applying the template too</p>
  
  <pre><code>{
      "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json",
      "contentVersion": "1.0.0.0",
      "parameters": {
          "eventGridSubscriptionName": {
              "type": "String",
              "metadata": {
                  "description": "The name of the Event Grid custom topic's subscription."
              }
          },
          "location": {
              "defaultValue": "[resourceGroup().location]",
              "type": "String",
              "metadata": {
                  "description": "The location in which the Event Grid resources should be deployed."
              }
          }
      },
      "resources": [
          {
              "type": "Microsoft.EventGrid/topics/providers/eventSubscriptions",
              "apiVersion": "2018-01-01",
              "name": "[concat('my-custom-topic', '/Microsoft.EventGrid/', parameters('eventGridSubscriptionName'))]",
              "location": "[parameters('location')]",
              "properties": {
                  "destination": {
                      "endpointType": "EventHub",
                      "properties": {
                          "resourceId": "..."
                      }
                  },
                  "filter": {
                      "includedEventTypes": [
                          "All"
                      ]
                  }
              }
          }
      ]
  }
  </code></pre>
  
  <p>If I change <code>name</code> to be a the full path of the topic (e.g. subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx/resourceGroups/publisher-group/providers/Microsoft.EventGrid/topics/my-custom-topic) then the template complains I have too many segments</p>
  
  <p>I would have thought this was a very common use case having topics and subscriptions in different resource groups but I am unable to find concrete examples of this</p>
  
  <p>How do I create an ARM template to subscribe to an event grid topic on a different resource group?</p>