48 views

Description

Pattern "Azure Database" always throws error in Discovery log:

Failed Exploring CI Pattern, Pattern name: Azure DataBase, To Check Pattern Log Press Here

If you open the Pattern log, expand the Azure Database section, and click on Get Databases MySQL, the following message is displayed:

Cloud request failed. URL: https://management.azure.com/subscriptions/. HTTP/1.1 404 Not Found

Clicking on "Change format from Json to XML"a  shows Groovy code failure: org.json.JSONException: Expected a ',' or '}' at ....

Steps to Reproduce

  1. Set up Cloud Discovery for Azure.

    For more information, see the product documentation topic Cloud discovery.

  2. Run discovery.

    Note that in Discovery Status, under Discovery Log, the following error is displayed:

    Failed Exploring CI Pattern, Pattern name: Azure DataBase, To Check Pattern Log Press Here

Workaround

You can either ignore the error, or use the following workaround: 

  1. Open pattern.

  2. Open Discovery Patterns.

  3. Open Azure Database and click on the link Azure Database under Identification Section.
    > Open step 6 Get DataBases MySQL.

  4. Edit the Value field, replace the full EVAL Script content with the following code:

    var ret = ''; 
    try{ 
    var result = CTX.getCommandManager().cloudApi('https://management.azure.com/subscriptions/'+${service_account[1].account_id}+'/resourcegroups/'+${resourcegroups_table[].name}+'/providers/Microsoft.DBforMySQL/servers?api-version=2017-12-01','cloud_context', ${service_account[1].discovery_credentials}, null, 'GET', null, true, CTX); }  catch(e) { ms.log("Azure DataBase pattern: MySQL REST query failed with error: " + e.getMessage() ); result = ''; } ret = result;
  5. Save the pattern and then Publish.

Note – Once the pattern is changed, it will not be automatically updated during platform upgrade. Therefore, if you upgrade to a version that contains a fix to this issue, revert the pattern to the default out of box version for the fix version.

 

 


Related Problem: PRB1277893

Seen In

There is no data to report.

Intended Fix Version

Madrid

Fixed In

London

Safe Harbor Statement

This "Intended Fix Version" information is meant to outline ServiceNow's general product direction and should not be relied upon in making a purchasing decision. The information provided here is for information purposes only and may not be incorporated into any contract. It is not a commitment, promise, or legal obligation to deliver any material, code, or functionality. The development, release, and timing of any features or functionality described for our products remains at ServiceNow's sole discretion.

Associated Community Threads

There is no data to report.

Article Information

Last Updated:2018-08-05 22:40:14
Published:2018-07-18