|
| 1 | +# Azure Deployment Setup Guide |
| 2 | + |
| 3 | +## Current Status |
| 4 | +✅ **Docker Build Fixed**: The platform-specific dependency issue has been resolved |
| 5 | +⚠️ **Deployment Issue**: Azure authentication needs to be configured |
| 6 | + |
| 7 | +## Deployment Options |
| 8 | + |
| 9 | +### Option 1: Service Principal Authentication (Recommended) |
| 10 | + |
| 11 | +1. **Create Azure Service Principal**: |
| 12 | + ```bash |
| 13 | + az ad sp create-for-rbac --name "GitHub-Actions-SP" --role contributor \ |
| 14 | + --scopes /subscriptions/{subscription-id}/resourceGroups/{resource-group} \ |
| 15 | + --sdk-auth |
| 16 | + ``` |
| 17 | + |
| 18 | +2. **Add GitHub Secret**: |
| 19 | + - Go to GitHub repo → Settings → Secrets and variables → Actions |
| 20 | + - Add new secret: `AZURE_CREDENTIALS` |
| 21 | + - Value: The entire JSON output from step 1 |
| 22 | + |
| 23 | +3. **Update Environment Variables**: |
| 24 | + - In `.github/workflows/deploy-azure.yml` |
| 25 | + - Change `AZURE_WEBAPP_NAME: 'your-app-name'` to your actual Azure App Service name |
| 26 | + |
| 27 | +### Option 2: Publish Profile Authentication |
| 28 | + |
| 29 | +1. **Get Publish Profile**: |
| 30 | + - In Azure Portal → App Service → Get publish profile |
| 31 | + - Download the `.publishsettings` file |
| 32 | + |
| 33 | +2. **Add GitHub Secret**: |
| 34 | + - Add new secret: `AZURE_WEBAPP_PUBLISH_PROFILE` |
| 35 | + - Value: Contents of the `.publishsettings` file |
| 36 | + |
| 37 | +3. **Use Alternative Workflow**: |
| 38 | + - Rename `deploy-azure-publishprofile.yml` to `deploy-azure.yml` |
| 39 | + - Or update the current workflow to use publish-profile instead of service principal |
| 40 | + |
| 41 | +## Required GitHub Secrets |
| 42 | + |
| 43 | +### For Service Principal (Current workflow): |
| 44 | +- `AZURE_CREDENTIALS`: JSON from service principal creation |
| 45 | + |
| 46 | +### For Publish Profile (Alternative): |
| 47 | +- `AZURE_WEBAPP_PUBLISH_PROFILE`: Contents of .publishsettings file |
| 48 | + |
| 49 | +## Azure App Service Setup |
| 50 | + |
| 51 | +1. **Create App Service**: |
| 52 | + ```bash |
| 53 | + # Create resource group |
| 54 | + az group create --name myResourceGroup --location "East US" |
| 55 | + |
| 56 | + # Create App Service plan |
| 57 | + az appservice plan create --name myAppServicePlan --resource-group myResourceGroup --is-linux --sku B1 |
| 58 | + |
| 59 | + # Create Web App |
| 60 | + az webapp create --name your-app-name --resource-group myResourceGroup --plan myAppServicePlan --deployment-container-image-name nginx |
| 61 | + ``` |
| 62 | + |
| 63 | +2. **Configure Container Settings**: |
| 64 | + - Enable container logging |
| 65 | + - Set startup command if needed |
| 66 | + - Configure environment variables |
| 67 | + |
| 68 | +## Testing the Deployment |
| 69 | + |
| 70 | +1. **Manual Trigger**: |
| 71 | + - Go to GitHub Actions → Deploy to Azure App Service → Run workflow |
| 72 | + |
| 73 | +2. **Automatic Trigger**: |
| 74 | + - Push changes to main branch |
| 75 | + - Docker build completes successfully |
| 76 | + - Deployment triggers automatically |
| 77 | + |
| 78 | +## Troubleshooting |
| 79 | + |
| 80 | +- **Authentication Errors**: Check if secrets are properly set |
| 81 | +- **Image Pull Errors**: Ensure GitHub Container Registry access is configured |
| 82 | +- **App Service Errors**: Check Azure App Service logs |
| 83 | + |
| 84 | +## Next Steps |
| 85 | + |
| 86 | +1. Choose authentication method (Service Principal recommended) |
| 87 | +2. Set up required GitHub secrets |
| 88 | +3. Update `AZURE_WEBAPP_NAME` in workflow |
| 89 | +4. Test deployment |
| 90 | + |
| 91 | +## Available Docker Images |
| 92 | + |
| 93 | +After the successful build, these images are available: |
| 94 | +- `ghcr.io/trackman/tps-app-scripting/app-scripting-editor:latest` |
| 95 | +- `ghcr.io/trackman/tps-app-scripting/app-scripting-editor:main` |
| 96 | +- `ghcr.io/trackman/tps-app-scripting/app-scripting-editor:main-<commit-sha>` |
0 commit comments