C# implementation of mslearn-ai-vision
These modules are used in the Microsoft Learn Develop computer vision solutions in Azure learning path.
Note that not all regions support all features of Azure AI Vision. See https://learn.microsoft.com/azure/ai-services/computer-vision/overview-image-analysis?WT.mc_id=DOP-MVP-5001655 for details.
az group create --location eastus --resource-group rg-computer-vision-eastus-001
# Prepare a service principal for Login with OIDC
az ad sp create-for-rbac --name sp-computer-vision-eastus-001 --role Contributor --scopes /subscriptions/<yoursubscription>/resourceGroups/rg-computer-vision-eastus-001
Make a note of the appId value, as you'll enter that as the --id
parameter.
Create credential.json (update octo-org
and octo-repo
to the GitHub organisation/username and repository name respectively)
{
"name": "main",
"issuer": "https://token.actions.githubusercontent.com",
"subject": "repo:octo-org/octo-repo:ref:refs/heads/main",
"description": "Main branch",
"audiences": [
"api://AzureADTokenExchange"
]
}
Use the appId
value from above for the --id
parameter
az ad app federated-credential create --id xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx --parameters credential.json
Get the Azure subscription ID:
az account subscription list
and then set the following as GitHub secrets
- AZURE_CLIENT_ID the Application (client) ID
- AZURE_TENANT_ID the Directory (tenant) ID
- AZURE_SUBSCRIPTION_ID your subscription ID
eg. via the GitHub CLI
gh secret set AZURE_CLIENT_ID --body "xxxx"
gh secret set AZURE_TENANT_ID --body "xxxx"
gh secret set AZURE_SUBSCRIPTION_ID --body "xxxxx"