How to maintain Credentials, connections, Alias, and Tenants in different instances

Shanmugam Kuvva
Tera Contributor

Hey everyone,

 

We configured SharePoint integration in our Dev, QA, and Prod instances using "Microsoft SharePoint Online Spoke" and created different Credentials, Connections, Alias, App registries, and Tenants in each instance. Please let us know if there are any best practices to maintain these records without interfering with the other Instances. Also, we are calling these spoke actions in a flow using the if, else if, and else conditions for each Instance. I appreciate your input on the best practices in this case.

2 REPLIES 2

Ankur Bawiskar
Tera Patron
Tera Patron

@Shanmugam Kuvva 

Best way is to create and configure them fresh in the respective instances.

Whatever is static such as OAuth app registry record etc if possible can be added to system property and can be used.

Credentials, connection, alias are not captured in update set.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

John Martin2
Tera Expert

DTech Apps' ServiceNow certified application, DocIntegrator, can significantly simplify the management of your multi-instance SharePoint integration and streamline your Flow Designer logic compared to relying solely on the "Microsoft SharePoint Online Spoke." Here's how it can help and best practices to consider:

How DocIntegrator Simplifies Multi-Instance Management:

  • Centralized Connection Management (Potentially): DocIntegrator often provides a more centralized way to manage connections to external systems like SharePoint. Instead of creating numerous individual Credentials, Connections, and Aliases, you might be able to configure a single DocIntegrator connection that can be parameterized or conditionally routed based on the instance.

  • Environment-Aware Configuration: DocIntegrator might offer features or configuration options specifically designed for managing integrations across multiple ServiceNow instances. This could involve using environment variables or lookup tables to dynamically determine the correct SharePoint tenant or credentials to use.

  • Simplified Flow Logic: DocIntegrator's actions within Flow Designer are often more high-level and abstract away some of the underlying complexity of the spoke actions. This can lead to cleaner and more maintainable flows, reducing the need for extensive if/else if/else branching based on the instance.

Best Practices for Maintaining Multi-Instance SharePoint Integrations (with or without DocIntegrator, but highlighting DocIntegrator's potential benefits):

  1. Externalize Configuration:

    • System Properties: Store environment-specific configuration details like SharePoint Tenant IDs, App Client IDs, and potentially even parts of the URL in ServiceNow System Properties (sys_properties). Your Flow Designer logic or DocIntegrator configuration can then dynamically look up these properties based on the current instance (gs.instanceId()).
    • Configuration Items (CIs): For more complex configurations, consider creating dedicated Configuration Items (CIs) for each environment that hold the necessary SharePoint connection details. You can then query these CIs within your flow based on the instance.
  2. Utilize Connection Aliases Effectively (Even with DocIntegrator): Continue using Connection Aliases, but structure them logically. You might have a base alias for "SharePoint" and then use environment-specific credentials associated with that alias. DocIntegrator can then be configured to use these aliases.

  3. Avoid Hardcoding Environment-Specific Values in Flows: Your current if/else if/else structure based on the instance is a common approach but can become cumbersome. Aim to make your flows more generic by referencing the externalized configurations mentioned above. DocIntegrator's more abstract actions can help here.

  4. Leverage ServiceNow's Instance Options: Be aware of ServiceNow's built-in mechanisms for managing configurations across instances, such as cloning exclusion lists to prevent development/test data from overwriting production. 1  

    1. Unknown Issues of Clone in ServiceNow with Example

     

  5. Document Thoroughly: Maintain clear documentation of your SharePoint integration setup for each instance, including the purpose of each credential, connection, alias, app registry, and tenant. Document how your Flow Designer logic determines which environment to interact with.

  6. Implement Robust Error Handling: Regardless of the tool used, ensure your flows have comprehensive error handling to gracefully manage connection failures or issues with specific environments. Log errors with context (including the instance ID) for easier troubleshooting.

  7. Version Control and Promotion: Use ServiceNow's Application Repository or other version control systems to manage and promote your integration configurations and flows between instances in a controlled manner.

Specific Ways DocIntegrator Can Improve Your Current Setup:

  • Simplified Connection Management: Explore if DocIntegrator allows you to define a single "SharePoint" connection and then use instance-specific authentication profiles or configurations within that connection. This would reduce the number of separate Connection records you need to maintain.
  • Dynamic SharePoint URL Resolution: Check if DocIntegrator offers features to dynamically determine the SharePoint Tenant or Site URL based on the ServiceNow instance or a configuration setting. This could eliminate the need for instance-specific logic within your flow to determine the correct URL.
  • More Abstract Actions: DocIntegrator's actions might handle the underlying authentication and connection details more transparently, allowing you to focus on the business logic of interacting with SharePoint (e.g., "Upload Document," "Get List Items") without needing to explicitly manage credentials and connections within each step.

Recommendation:

The best practice is to externalize your environment-specific configurations (using System Properties or CIs) and then modify your Flow Designer logic to dynamically reference these configurations based on the current ServiceNow instance.

Evaluate DTech Apps DocIntegrator's specific features for multi-instance management. Review their documentation and consider reaching out to their support to understand how their application can streamline your current setup and potentially reduce the complexity of your Flow Designer flows. It's possible that DocIntegrator offers a more elegant and maintainable way to handle multi-environment integrations compared to the granular management required by the out-of-the-box spoke actions.