0

I have one workspace in Azure Cloud and in which I have lot's of Dashboard, savedSearches and Alerts in Log-Analytics(OMS). Now I want to copy everything into another workspace how can I do that?

One way that I know is I can export every dashboard from one workspace and import that into other workspace. But I have many dashboards and I want to copy that into multiple workspace. And also I want to copy all the alerts.

There is a REST API available I tried but failed to execute successfully. I've tried following two ways:

  1. Using Postman
    Problem : Authentication Failed with Azure service

  2. Using Python Script
    Problem : This python Script failed to access URL(403)

Please suggest me the best way. Thanks in advance.

JavaCoder
  • 11
  • 4
  • You give your sp `Owner` role? https://learn.microsoft.com/en-us/azure/azure-resource-manager/resource-group-create-service-principal-portal#assign-application-to-role – Shui shengbao Feb 02 '18 at 05:14
  • Thanks @ShengbaoShui-MSFT, https://management.azure.com/subscriptions//resourcegroups//providers/Microsoft.OperationalInsights/workspaces//savedSearches?api-version=2015-11-01-preview I'm using this link to get all savedSearches, Am I wrong here? Because I'm still getting 401 error. – JavaCoder Feb 02 '18 at 05:50
  • This is a Azure Rest API, do you get token firstly? – Shui shengbao Feb 02 '18 at 05:53
  • Yes, I got token and put in header with Authorization key. Now I'm getting following ERROR: HTTPError: 400 Client Error: Bad Request for url. – JavaCoder Feb 02 '18 at 05:56
  • How do you call your API, you could check my answer about this. https://stackoverflow.com/questions/48506272/authenticationfailedinvalidheader-when-using-the-azure-api-management-rest-api/48512595#48512595 – Shui shengbao Feb 02 '18 at 05:58
  • I check the link you provided, the example does not provided `resource`, you could get token like this. https://imgur.com/a/SuYSn – Shui shengbao Feb 02 '18 at 06:01
  • I've tried the by postman the way you provided but still getting 400 Bad Request for URL, check if anything wrong with my URL. I want to just export all the alerts and saved seaches, and if possible all the dashboards at once. – JavaCoder Feb 02 '18 at 06:14
  • Could you share some screenshot? – Shui shengbao Feb 02 '18 at 06:17
  • Check this link https://blog.jongallant.com/2017/11/azure-rest-apis-postman/ – Shui shengbao Feb 02 '18 at 06:20
  • May be my setup is wrong somewhere, but forget that and if you can suggest : How can I copy all the dashboards(if possible then with saved seaches and alerts) from one workspace to another. – JavaCoder Feb 02 '18 at 06:32
  • The api you used does not work? Honestly speaking I am not good at this. – Shui shengbao Feb 02 '18 at 06:34
  • Thanks, Actially I'm not good at Azure Cloud itself. But If you know any other way for this : How can I copy all the dashboards(if possible then with saved seaches and alerts) from one workspace to another. – JavaCoder Feb 02 '18 at 06:42
  • You check this [blog](https://blogs.technet.microsoft.com/manuelpuron/2017/07/14/export-all-alerts-created-in-a-oms-workspace-to-csv/)? – Shui shengbao Feb 02 '18 at 06:46

0 Answers0