Are you having problem with Container Apps or App Services?
To deploy to Azure Container Apps, I use these scripts:
# Step 6: Create a Container Apps environment
Write-Host "`nCreating a Container Apps environment named '${environmentName}'"
$containerEnv = az containerapp env create `
--name $environmentName `
--resource-group $rgname `
--location $location `
--logs-workspace-id $workspaceId `
--logs-workspace-key $workspaceKey `
--output json | ConvertFrom-Json
Write-Host "Container Apps Environment created"
# Step 7: Create Azure Container App for CloudDebugger
# Set DEPLOY_TRIGGER to a random value to force a redeployment
Write-Host "`nCreating Azure Container App for CloudDebugger"
$randomValue = [guid]::NewGuid().ToString()
$container = az containerapp create `
--name $containerAppName `
--environment $environmentName `
--resource-group $rgname `
--user-assigned $identityId `
--registry-identity $identityId `
--registry-server "${acrname}.azurecr.io" `
--image "${acrname}.azurecr.io/${imagename}:latest" `
--target-port 8080 `
--ingress external `
--cpu 0.25 `
--memory 0.5 `
--min-replicas 1 `
--max-replicas 1 `
--env-vars AZURE_CLIENT_ID=$clientId DEPLOY_TRIGGER=$randomValue `
--output json | ConvertFrom-Json
$containerId = $container.id
if you have problems with deploying to App Services, then I have a blog post about that here:
Deploy Container to Azure App Services with System-Assigned Identity
Where I use this command to update the container deployment:
$imagePath = "${acrname}.azurecr.io/${imagename}:latest"
Write-Host "`n`nChange the service to use the container ${imagePath}."
az webapp config container set `
--name $AppServiceName_container_linux `
--resource-group $rgname `
--container-image-name $imagePath `
--output json | ConvertFrom-Json
az webapp config container set --docker-custom-image-name MyDockerCustomImage --docker-registry-server-password StrongPassword --docker-registry-server-url https://{azure-container-registry-name}.azurecr.io --docker-registry-server-user DockerUserId --name MyWebApp --resource-group MyResourceGroup(or)az webapp config container set --docker-custom-image-name MyDockerCustomImage --docker-registry-server-url https://{azure-container-registry-name}.azurecr.io --name MyWebApp --resource-group MyResourceGroupaz webapp create --resource-group MyResourceGroup --plan MyAppServicePlan --name MyWebApp --deployment-container-image-name MyACR.azurecr.io/myimage:latest