microsoft / Azure-Analytics-and-AI-Engagement

Azure Analytics and AI Engagement
Other
140 stars 118 forks source link

FSI: bug in fsiSetup.ps1 when calling az cli #111

Closed larryclaman closed 3 years ago

larryclaman commented 3 years ago

In the FSI branch, the configuration script fsiSetup.ps1 uses a mix of powershell & az CLI commands. There is a bug in that the script assumes that the az commands are outputting json, which is not necessarily the case if the user has changed their defaults.

eg, the line

$userName = ((az ad signed-in-user show) | ConvertFrom-JSON).UserPrincipalName

should be rewritten in the form of:

$userName = ((az ad signed-in-user show --output json) | ConvertFrom-JSON).UserPrincipalName

similarly for:

    $global:powerbitoken = ((az account get-access-token --resource https://analysis.windows.net/powerbi/api) | ConvertFrom-Json).accessToken
    $global:synapseToken = ((az account get-access-token --resource https://dev.azuresynapse.net) | ConvertFrom-Json).accessToken
    $global:graphToken = ((az account get-access-token --resource https://graph.microsoft.com) | ConvertFrom-Json).accessToken
    $global:managementToken = ((az account get-access-token --resource https://management.azure.com) | ConvertFrom-Json).accessToken
etc.....
xor-ranavikrant commented 3 years ago

Thanks for the suggestion. We've updated our scripts to incorporate this.