Skip to content

Commit

Permalink
{Graph} Build base URL correctly for sovereign clouds (#22565)
Browse files Browse the repository at this point in the history
  • Loading branch information
jiasli authored May 23, 2022
1 parent 23b944a commit 913767e
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ def __init__(self, cli_ctx):
self.scopes = resource_to_scopes(cli_ctx.cloud.endpoints.microsoft_graph_resource_id)

# https://graph.microsoft.com/ (AzureCloud)
# https://microsoftgraph.chinacloudapi.cn (AzureChinaCloud)
self.resource = cli_ctx.cloud.endpoints.microsoft_graph_resource_id

# https://graph.microsoft.com/v1.0
self.base_url = cli_ctx.cloud.endpoints.microsoft_graph_resource_id + 'v1.0'
# https://microsoftgraph.chinacloudapi.cn/v1.0
self.base_url = cli_ctx.cloud.endpoints.microsoft_graph_resource_id.rstrip('/') + '/v1.0'

def _send(self, method, url, param=None, body=None):
url = self.base_url + url
Expand Down

0 comments on commit 913767e

Please sign in to comment.