<h2>Credential exchange between ServiceNow API and Azure Cloud</h2><br/><div style="overflow-x:auto"><article><div ><h3 >Issue </h3><section><style type="text/css"><!-- div.margin{ padding: 10px 40px 40px 30px; } table.tocTable{ border: 1px solid; border-color:#E0E0E0; background-color: rgb(245, 245, 245); padding-top: .6em; padding-bottom: .6em; padding-left: .9em; padding-right: .6em; } table.noteTable{ border:1px solid; border-color:#E0E0E0; background-color: rgb(245, 245, 245); width: 100%; border-spacing:2; } table.internaltable { white-space:nowrap; text-align:left; border-width: 1px; border-collapse: collapse; font-size:14px; width: 85%; } table.internaltable th { border-width: 1px; padding: 5px; border-style: solid; border-color: rgb(245, 245, 245); background-color: rgb(245, 245, 245); } table.internaltable td { border-width: 1px; padding: 5px; border-style: solid; border-color: #E0E0E0; color: #000000; } table tr td { padding: 15px; } .title { color: #D1232B; font-weight:normal; font-size:28px; } h1{ color: #D1232B; font-weight:normal; font-size:21px; margin-bottom:-5px } h2{ color: #646464; font-weight:bold; font-size:18px; } h3{ color: #000000; font-weight:BOLD; font-size:16px; text-decoration:underline; } h4{ color: #646464; font-weight:BOLD; font-size:15px; text-decoration:; } h5{ color: #000000; font-weight:BOLD; font-size:13px; text-decoration:; } h6{ color: #000000; font-weight:BOLD; font-size:14px; text-decoration:; } hr{ border-top-width: 1px; border-top-style: solid; border-top-color: #cccccc; } ul { list-style: disc outside none; margin-left: 0; } li { padding-left: 1em; } --></style> <div class="margin"> <h1>Overview</h1> <hr style="border-top-width: 1px; border-top-style: solid; border-top-color: #cccccc;" /> <p style="padding-left: 60px;">This article will demonstrate about the Credential exchange or handshake between the ServiceNow Cloud Management Platform API and Azure Cloud.</p> <h1>Description</h1> <hr style="border-top-width: 1px; border-top-style: solid; border-top-color: #cccccc;" /> <ul style="list-style-position: inside;"><li>During an API call to discover resources in Azure, the <strong><span style="font-family: 'courier new', courier;">API DSL</span></strong> is populated with the credential id and this is sent to the probe.</li><li>The probe <span style="font-family: 'courier new', courier;"><strong>APIProxyProbe</strong></span> is what runs in the ECC queue when we discover any resources in CMP.</li><li>This probe has a method called <span style="font-family: 'courier new', courier;"><strong>getCredentialsById</strong></span>(credential) which uses a factory method to get the Credential details back to the probe.</li><li>The probe then uses <span style="font-family: 'courier new', courier;"><strong>camel context</strong></span> to send the credentials as part of the request header to endpoints.</li><li>This header is provided to the script that is defined in the CAPI method mapper which uses rest API calls to discover the resources.</li><li>Understand which script includes are mapped to a particular discovery please check the <span style="font-family: 'courier new', courier;"><strong>CAPI method mappers</strong></span>. For eg :</li></ul> <pre><br />http://<instance-name>/sn_capi_method_mapper.do?sys_id=2686aa710b2322003969a387b6673a6b&sysparm_view=&sysparm_record_target=sn_capi_method_mapper&sysparm_record_row=25&sysparm_record_list=cloud_api%3D30866e310b2322003969a387b6673ae1%5EORDERBYcapi_interface_operation&sysparm_record_rows=37<br /><br /></pre> <ul style="list-style-position: inside;"><li>This is the method mapper that describes ListNodes operation.</li><li>The Mid Script includes <span style="font-family: 'courier new', courier;"><strong>"azure-compute-1.0-ListNodes"</strong></span> runs and discovers the VM in Azure.</li><li>Camel context is an interface used to represent the context used to configure routes and the policies to use during message exchanges between endpoints.</li><li>These are the Java class that ServiceNow using <span style="font-family: 'courier new', courier;"><strong>CAPIOrchestratorServiceImpl</strong></span> & <span style="font-family: 'courier new', courier;"><strong>APIProxyProbe</strong></span></li></ul> <h1>capiSvrScript.findMatchingMid() </h1> <hr style="border-top: 1px solid #cccccc;" /> <ul style="list-style-position: inside;"><li><strong>capiSvrScript.findMatchingMid()</strong> is a java scripted API which is responsible to verify the Active MID with Cloud capabilities.</li><li>In this method, we get all matching mids based on capabilities and target(IP Range) then we get active mid, again, based on capabilities, target, and other parameters.</li><li>After that, we call the override mid and this script is had coded, we do not expect this to be changed.</li></ul> <h1>Additional Information</h1> <hr style="border-top-width: 1px; border-top-style: solid; border-top-color: #cccccc;" /> <ul style="list-style-position: inside;"><li>Once the discovery executes the UI action "<strong><span style="font-family: 'courier new', courier;">Get Subscriptions</span></strong>" would perform successful or unsuccessful authorization if the authorization fails it would throw an error here.</li></ul> <p style="padding-left: 90px;"><span style="font-family: 'courier new', courier;">https://<Instancename>.service-now.com/sys_ui_action.do?sys_id=5c3f4c1e0b1003003503e0d425673a59&sysparm_view=</span></p> <h1>Product Documentation </h1> <hr style="border-top: 1px solid #cccccc;" /> <ul style="list-style-position: inside;"><li>Credential handling between MID and Instance: <a title="Getting started with credentials" href="https://docs.servicenow.com/csh?topicname=r-credentials.html&version=latest#d562806e131" target="_blank" rel="noopener noreferrer nofollow">Getting started with credentials</a></li><li>Details of encryption between MID Server and Azure: <a title="Set up MID Servers to connect Cloud Management to an Azure account" href="https://docs.servicenow.com/csh?topicname=azure-setup-mid-server-cloud-mgt.html&version=latest" target="_blank" rel="noopener noreferrer nofollow">Set up MID Servers to connect Cloud Management to an Azure account</a></li><li>Details of MID server Security: <a title="MID Server security and encryption" href="https://docs.servicenow.com/csh?topicname=mid-server-security-encryption.html&version=latest" target="_blank" rel="noopener noreferrer nofollow">MID Server security and encryption</a></li></ul> </div></section></div></article></div>