-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
az ml environment create is not working in github actions. #28911
Comments
Hi @Ioannis-Mykelos, 2.59.0 is not the latest Azure CLI(2.60.0). If you haven't already attempted to do so, please upgrade to the latest Azure CLI version by following https://learn.microsoft.com/en-us/cli/azure/update-azure-cli. |
Thank you for opening this issue, we will look into it. |
Any updates on our issue? |
I encountered a similar issue where the
|
Any news? |
Any updates? |
1 similar comment
Any updates? |
@Ioannis-Mykelos - yml and debug logs are matching, as per workflow file, you using CLI V1 [az extension add -n azure-cli-ml --yes]. @subesokun - Can you please confirm if you are using Linux, data mount is a preview feature and only supported on linux https://learn.microsoft.com/en-us/cli/azure/ml/data?view=azure-cli-latest#az-ml-data-mount |
@subesokun - |
After |
Just for the sake of knowledge transfer. You need 2 things to make it work: 1. the yml file below # This workflow will build and push a Docker container to the Environments (in Azure ML studio).
name: Build & register an Env in AML Studio.
# Enable a workflow to be triggered manually using the GitHub API, GitHub CLI, or GitHub browser interface.
on: workflow_dispatch
env:
CONTAINER_NAME: "${{ secrets.RESOURCE_GROUP_NAME }}-env"
permissions:
id-token: write
contents: read
jobs:
build-and-deploy:
runs-on: ubuntu-latest
environment: Development # This is the name of the Environment you will create in this Repository.
name: Build & register environment # This name will be displayed in the Actions tab of the repository.
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Log in with Azure # Need to create federated credentials in App registration in Azure AD.
uses: azure/login@v1
with:
tenant-id: ${{ secrets.TENANT_ID }} # Tenant-id of the App Registration
subscription-id: ${{ secrets.SUBSCRIPTION_ID}} # Sub id, for dev, test, or prod
client-id: "${{ secrets.CLIENT_ID}}" # Clinet-id of the App Registration
- name: Log in to Azure container registry
uses: azure/docker-login@v1
with:
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
login-server: "${{ secrets.AZURE_CONTAINER_REGISTRY_NAME }}" # ensure your login-server matches the fully qualified path to your image
- name: Build and push container image to registry
run: |
DOCKER_BUILDKIT=1 docker build \
-t "${{env.CONTAINER_NAME}}" \
-f docker/Dockerfile.environment \
--build-arg ssh_prv_key="${{ secrets.FEEDBACK_ANALYZER_DEPLOYKEY }}" \
--build-arg ssh_prv_key_sub="${{ secrets.FEEDBACK_ANALYZER_DEPLOYKEY }}" \
--build-arg ssh_ml_utils="${{ secrets.FEEDBACK_ANALYZER_DEPLOYKEY }}" \
--build-arg git_branch_name="${{ github.ref_name }}" \
--build-arg git_repository_name="${{ github.event.repository.name }}" .
docker tag "${{env.CONTAINER_NAME}}" "${{ vars.AZURE_CONTAINER_REGISTRY_NAME }}/environments/${{env.CONTAINER_NAME}}:latest"
docker push "${{ vars.AZURE_CONTAINER_REGISTRY_NAME }}/environments/${{env.CONTAINER_NAME}}:latest"
- name: Run Azure CLI script
uses: azure/CLI@v2
with:
azcliversion: 2.53.1
inlineScript: |
echo "-- Checking and registering the environment in Azure ML Studio --"
az extension add -n ml --yes
if az ml environment list -w "${{ secrets.WORKSPACE_NAME }}" -g "${{ secrets.RESOURCE_GROUP }}" -o table | grep -q "${{env.CONTAINER_NAME}}"; then echo "Environment already registered!!!"; else az ml environment create --name "${{env.CONTAINER_NAME}}" -i "${{ env.CONTAINER_NAME }}/environments/${{env.CONTAINER_NAME}}:latest" -w "${{ secrets.WORKSPACE_NAME }}" -g "${{ secrets.RESOURCE_GROUP }}"; fi 2. Federated credential And add a federated credential with:
And you create your credential with a name you decide (this name plays no role in authentication) |
Describe the bug
Trying create a step in my GitHub action to:
Related command
The
yml
is the following:All steps are working except the last part, when running the step (name: Run Azure CLI script) of creating the Environment.
Errors
Issue script & Debug output
The results are :
Expected behavior
I am expecting the GitHub action to check if there is a registered environment in the Azure ML studio for the Workspace.
If there is then echo a message, if not then create one (poetry environment registration), according to our poetry file.
Environment Summary
Additional context
No response
The text was updated successfully, but these errors were encountered: