Closed xpdable closed 2 years ago
I even hardcode the base url in the init py to :
def init_resource_graph_client(
experiment_secrets: Secrets) -> ResourceGraphClient:
"""
Initializes Resource Graph client.
"""
secrets = load_secrets(experiment_secrets)
with auth(secrets) as authentication:
base_url = secrets.get('cloud').endpoints.resource_manager
client = ResourceGraphClient(
credential=authentication,
base_url="https://management.chinacloudapi.cn")
return client
OK, I find sth. The current code is using ClientSecretCredentialBase
from Azure Python SDK
My commit which works used from msrestazure.azure_active_directory import ServicePrincipalCredentials
which works with the configure of from msrestazure.azure_cloud import AZURE_PUBLIC_CLOUD, AZURE_US_GOV_CLOUD, AZURE_GERMAN_CLOUD, AZURE_CHINA_CLOUD
this is not work with Azure Python SDK
@russmiles @Lawouach @buderre Any suggestion? I will have to modify my previous code maybe
Seems not a issue with CTK. reproduced just by scripts. I've raised support case to Azure.
Seems not a issue with CTK. reproduced just by scripts. I've raised support case to Azure.
Seems Azure support is not so professional as me, still waiting for the solution
Ok, it is provide that *Configuration
of Client of Azure SDK now accepts credential_scopes to eventually do the conection.
You will specify in the Client init
client = ComputeManagementClient(
credential=result,
client_credential=result,
credential_scopes=('https://management.chinacloudapi.cn/.default',),
subscription_id='ed886107-0f48-4043-835a-2394a94f21a8',
base_url=base_url)
class ComputeManagementClientConfiguration(Configuration):
...
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
More words that Azure support sucks
I implemented this feature years ago with a setting to specify the cloud:
Now it is not working with latest code