This commit is contained in:
David Laufer 2018-08-23 14:52:55 +03:00
parent 8d45fba6d4
commit 9c9d0cf1fd
4 changed files with 5 additions and 5 deletions

View File

@ -21,7 +21,7 @@ In this section we share Power BI query sample to run a query using application
If you want to use user token instead please refer to [this](run-advanced-query-sample-power-bi-user-token.md) tutorial. If you want to use user token instead please refer to [this](run-advanced-query-sample-power-bi-user-token.md) tutorial.
>**Prerequisite**: You first need to [create an app](exposed-apis-create-app-webapp). >**Prerequisite**: You first need to [create an app](exposed-apis-create-app-webapp.md).
## Run a query ## Run a query
@ -45,7 +45,7 @@ If you want to use user token instead please refer to [this](run-advanced-query-
AppSecret = "22222222-2222-2222-2222-222222222222", // Paste your own app secret here AppSecret = "22222222-2222-2222-2222-222222222222", // Paste your own app secret here
Query = "MachineInfo | where EventTime > ago(7d) | summarize EventCount=count(), LastSeen=max(EventTime) by MachineId", // Paste your own query here Query = "MachineInfo | where EventTime > ago(7d) | summarize EventCount=count(), LastSeen=max(EventTime) by MachineId", // Paste your own query here
ResourceAppIdUrl = "https://securitycenter.onmicrosoft.com/windowsatpservice", ResourceAppIdUrl = "https://api.securitycenter.windows.com",
OAuthUrl = Text.Combine({"https://login.windows.net/", TenantId, "/oauth2/token"}, ""), OAuthUrl = Text.Combine({"https://login.windows.net/", TenantId, "/oauth2/token"}, ""),
Resource = Text.Combine({"resource", Uri.EscapeDataString(ResourceAppIdUrl)}, "="), Resource = Text.Combine({"resource", Uri.EscapeDataString(ResourceAppIdUrl)}, "="),

View File

@ -21,7 +21,7 @@ In this section we share Power BI query sample to run a query using user token.
If you want to use application token instead please refer to [this](run-advanced-query-sample-power-bi-app-token.md) tutorial. If you want to use application token instead please refer to [this](run-advanced-query-sample-power-bi-app-token.md) tutorial.
>**Prerequisite**: You first need to [create an app](exposed-apis-create-app-nativeapp). >**Prerequisite**: You first need to [create an app](exposed-apis-create-app-nativeapp.md).
## Run a query ## Run a query

View File

@ -40,7 +40,7 @@ $tenantId = '00000000-0000-0000-0000-000000000000' # Paste your own tenant ID he
$appId = '11111111-1111-1111-1111-111111111111' # Paste your own app ID here $appId = '11111111-1111-1111-1111-111111111111' # Paste your own app ID here
$appSecret = '22222222-2222-2222-2222-222222222222' # Paste your own app secret here $appSecret = '22222222-2222-2222-2222-222222222222' # Paste your own app secret here
$resourceAppIdUri = 'https://securitycenter.onmicrosoft.com/windowsatpservice' $resourceAppIdUri = 'https://api.securitycenter.windows.com'
$oAuthUri = "https://login.windows.net/$TenantId/oauth2/token" $oAuthUri = "https://login.windows.net/$TenantId/oauth2/token"
$body = [Ordered] @{ $body = [Ordered] @{
resource = "$resourceAppIdUri" resource = "$resourceAppIdUri"

View File

@ -37,7 +37,7 @@ appSecret = '22222222-2222-2222-2222-222222222222' # Paste your own app secret h
url = "https://login.windows.net/%s/oauth2/token" % (tenantId) url = "https://login.windows.net/%s/oauth2/token" % (tenantId)
resourceAppIdUri = 'https://securitycenter.onmicrosoft.com/windowsatpservice' resourceAppIdUri = 'https://api.securitycenter.windows.com'
body = { body = {
'resource' : resourceAppIdUri, 'resource' : resourceAppIdUri,