Skip to content
Snippets Groups Projects

Update PLAYBOOK_FOR_TOPIC_CREATION.md

Closed Nikhil Singh[MicroSoft] requested to merge users/nikhil/topicDocUpdate into master
1 unresolved thread
1 file
+ 7
16
Compare changes
  • Side-by-side
  • Inline
# SOPs for Creating a new Topic and Adding subscriber for it.
### Introduction
Notification service is invoked by PubSub called [Event Grid](https://docs.microsoft.com/en-us/azure/event-grid/).
This document describes how to create an Event Grid Topic in OSDU universe, before you can start consuming it.
Notification service is invoked by PubSub called [Service Bus](https://docs.microsoft.com/en-us/azure/service-bus-messaging/).
This document describes how to create a Service Bus Topic in OSDU universe, before you can start consuming it.
### How to create the Topic
#### 1. Create Event Grid Topic on infrastructure.
#### 1. Create Service Bus Topic on infrastructure.
Following this will enable creation of topic in all data partitions.
1. Create a Topic via terraform. [Reference](https://community.opengroup.org/osdu/platform/deployment-and-operations/infra-azure-provisioning/-/blob/master/infra/templates/osdu-r3-mvp/data_partition/main.tf#L301)
2. Assign the Service Principals of service the role "EventGrid EventSubscription Contributor". [Reference](https://community.opengroup.org/osdu/platform/deployment-and-operations/infra-azure-provisioning/-/merge_requests/32)
3. Identify the fully qualified topic name and it's alias. The fully qualified topic name is the one you see on the Azure portal. An example is "osdu-env-dp1env-as12-grid-recordstopic". The alias could be recordstopic. Make sure the alias ends with topic. Invalid topic names will be "testtopic1", "test_topic", "testtopics" etc.
4. Create secrets in Common Resources Key Vault that helps your service identify the event grid topic end point. [Reference](https://community.opengroup.org/osdu/platform/deployment-and-operations/infra-azure-provisioning/-/merge_requests/30/diffs)
Make sure you name them in the format "eventgrid-\<alias\>" and "eventgrid-\<alias\>-accesskey". For example, if the topic alias is "testtopic", the keys should look like "eventgrid-testtopic-accesskey" and "eventgrid-testtopic".
1. Create a Topic via terraform. [Reference](https://community.opengroup.org/osdu/platform/deployment-and-operations/infra-azure-provisioning/-/blob/master/infra/templates/osdu-r3-mvp/data_partition/main.tf#L387)
2. Assign the Service Principals of service the role "Azure Service Bus Data Sender". [Reference](https://community.opengroup.org/osdu/platform/deployment-and-operations/infra-azure-provisioning/-/blob/master/infra/templates/osdu-r3-mvp/data_partition/main.tf#L332)
#### 2. Make partition service aware of the new topic.
Partition service maintains the configuration for each infrastructure component.
For all the tenants, add the new topic information. [Reference](https://community.opengroup.org/osdu/platform/deployment-and-operations/infra-azure-provisioning/-/merge_requests/101)
This is to be done per partition per deployment.
#### 3. Make Register service aware of the new Topic, if the consumers are outside the bounds of OSDU.
1. Add the topic alias to [topics.json](https://community.opengroup.org/osdu/platform/system/register/-/blob/master/provider/register-azure/src/main/resources/topics.json). Make sure you fill in the values of description, state and examples to ensure that the get Topic API contract is not broken.
#### 2. Make Register service aware of the new Topic, if the consumers are outside the bounds of OSDU.
1. Add the topic to [topics.json](https://community.opengroup.org/osdu/platform/system/register/-/blob/master/provider/register-azure/src/main/resources/topics.json). Make sure you fill in the values of description, state and examples to ensure that the get Topic API contract is not broken.
Loading