Azure / aml-workspace

GitHub Action that allows you to create or connect to your Azure Machine Learning Workspace.
MIT License
22 stars 16 forks source link

Support for Sovereign cloud like AzureUSGovernment #18

Closed actions-devops closed 4 years ago

actions-devops commented 4 years ago

It appears that the auth main.py assumes AzureCloud

    # Loading Workspace
    sp_auth = ServicePrincipalAuthentication(
        tenant_id=azure_credentials.get("tenantId", ""),
        service_principal_id=azure_credentials.get("clientId", ""),
        service_principal_password=azure_credentials.get("clientSecret", "")
    )

Suggest something like:

# Get management Url and check to see if it is Government  

managementurl = azure_credentials.get("managementEndpointUrl", "")

if managementurl = "https://management.core.usgovcloudapi.net":
            sp_cloud="AzureUSGovernment"
        else:
            sp_cloud="AzureCloud"

    # Loading Workspace
    sp_auth = ServicePrincipalAuthentication(
        tenant_id=azure_credentials.get("tenantId", ""),
        service_principal_id=azure_credentials.get("clientId", ""),
        service_principal_password=azure_credentials.get("clientSecret", ""),
        cloud=sp_cloud)
marvinbuss commented 4 years ago

@actions-devops Thanks for submitting the feature request. How urgent is your request?

actions-devops commented 4 years ago

next one to two months.. if that doesn't happen I may issue a PR or use a fork

marvinbuss commented 4 years ago

We will definitely add support by then. Thanks for letting us know this early.

marvinbuss commented 4 years ago

@actions-devops I have created branches (all called target_cloud) and PRs for this feature. I don't have access to AzureUSGovernment, so I would appreciate if you could run a first test based on this sample repo: https://github.com/machine-learning-apps/ml-template-azure

Are you familiar with GH Actions and how to test these branches?

In the workflow file (https://github.com/machine-learning-apps/ml-template-azure/blob/master/.github/workflows/train_deploy.yml), you can just specify:

uses: Azure/aml-workspace@target_cloud

instead of

uses: Azure/aml-workspace@v1

Please do this for all Actions (uses: Azure/aml-workspace@target_cloud, uses: Azure/aml-compute@target_cloud, etc.)

actions-devops commented 4 years ago

target_cloud bits worked great against AzureUSGovernment

output: Message: No workspaces found with name=amlworkspaceaction in subscription=*** InnerException None ErrorResponse


"error": ***
    "message": "No workspaces found with name=amlworkspaceaction in subscription=***"
***

Deploying KeyVault with name amlworkskeyvault56e0e843. Deploying AppInsights with name amlworksinsightsad7dca9b. Deployed AppInsights with name amlworksinsightsad7dca9b. Took 2.06 seconds. Deploying StorageAccount with name amlworksstorage318090a86. Deploying Workspace with name amlworkspaceaction. Deployed KeyVault with name amlworkskeyvault56e0e843. Took 20.3 seconds. Deployed StorageAccount with name amlworksstorage318090a86. Took 20.29 seconds. Deployed Workspace with name amlworkspaceaction. Took 23.59 seconds.

Following resources were created. image

marvinbuss commented 4 years ago

@actions-devops Looks like this works as expected. We will try to get access to Azure US Government Cloud next week to add some integration tests. I will look into the other issue, that you have submitted, in the next few days.

marvinbuss commented 4 years ago

@actions-devops You can now use the v1 tag again (uses: Azure/aml-...@v1). We merged the changes and added a new release for each action.