GitHub Actions deployment is failing with error:
Login failed with Error: Using auth-type: SERVICE_PRINCIPAL.
Not all values are present. Ensure 'client-id' and 'tenant-id' are supplied.
- Login to Azure CLI:
az login- Get your subscription ID:
az account show --query id -o tsv- Create service principal with correct format:
# Replace YOUR_SUBSCRIPTION_ID with actual ID
az ad sp create-for-rbac \
--name "github-actions-crove" \
--role contributor \
--scopes /subscriptions/YOUR_SUBSCRIPTION_ID/resourceGroups/Crove \
--sdk-auth- Copy the JSON output (should look like this):
{
"clientId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"clientSecret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"subscriptionId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"tenantId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"activeDirectoryEndpointUrl": "https://login.microsoftonline.com",
"resourceManagerEndpointUrl": "https://management.azure.com/",
"activeDirectoryGraphResourceId": "https://graph.windows.net/",
"sqlManagementEndpointUrl": "https://management.core.windows.net:8443/",
"galleryEndpointUrl": "https://gallery.azure.com/",
"managementEndpointUrl": "https://management.core.windows.net/"
}- Update GitHub secret:
# Delete old secret
gh secret delete AZURE_CREDENTIALS --repo CroveAI/Crove
# Add new secret (paste the JSON when prompted)
gh secret set AZURE_CREDENTIALS --repo CroveAI/CroveSince Docker Hub credentials are working, we can simplify the deployment:
- Update the workflow to use SSH instead of Azure CLI:
Edit .github/workflows/deploy-azure-vm.yml:
- Remove Azure login step
- Use SSH action instead of Azure CLI
- Add SSH key to GitHub secrets:
# Generate SSH key if not exists
ssh-keygen -t ed25519 -C "github-actions" -f ~/.ssh/github-actions -N ""
# Add public key to Azure VM
ssh-copy-id -i ~/.ssh/github-actions.pub joy@52.172.194.116
# Add private key to GitHub
gh secret set SSH_PRIVATE_KEY --repo CroveAI/Crove < ~/.ssh/github-actionsUse the deployment script:
./deploy-beta.shOr trigger deployment manually via SSH:
ssh joy@52.172.194.116 "cd /home/joy/crove && git pull && docker-compose -f docker-compose.production.yml up -d --build"After fixing, test the deployment:
- Trigger GitHub Actions manually:
gh workflow run "Deploy to Azure VM" --repo CroveAI/Crove- Watch the run:
gh run watch --repo CroveAI/Crove- Check deployment status:
curl -I https://beta.crove.com- ✅ Docker Hub credentials: Working
- ✅ Docker image build: Working
- ❌ Azure login: Failed (incorrect credential format)
- ❌ VM deployment: Not reached due to Azure login failure
- Fix Azure credentials (recommended)
- Or switch to SSH-based deployment
- Or use manual deployment until resolved