Closed lao8n closed 11 months ago
i think it is because the custom domain mapping gets wiped everytime i deploy as well
nothing beats old fashioned stack overflow https://stackoverflow.com/questions/76392675/use-bicep-to-deploy-an-azure-container-app-with-a-managed-certificate#:~:text=Create%20app%20environment%20and%20app%20container%20and%20also,in%20customer%20domain%20configuration%20%28Refer%20to%20customDomains%20property%29.
deployment failed for the managed certificate
Run azd provision --no-prompt
Provisioning Azure resources (azd provision) Provisioning Azure resources can take some time
Downloading Bicep Creating a deployment plan Creating/Updating resources You can view detailed progress in the Azure Portal: https://portal.azure.com/#blade/HubsExtension/DeploymentDetailsBlade/overview/id/%2Fsubscriptions%2F98d3a17a-a631-4a58-85f7-db2d9a7abae6%2Fproviders%2FMicrosoft.Resources%2Fdeployments%2Fcnstlltn-prod-1688748161
(✓) Done: Resource group: rg-cnstlltn-prod (✓) Done: Key Vault: kv-4a73yskoiju2e (✓) Done: Log Analytics workspace: log-4a73yskoiju2e (✓) Done: Application Insights: appi-4a73yskoiju2e (✓) Done: Portal dashboard: dash-4a73yskoiju2e (✓) Done: Azure Cosmos DB: cosmos-4a73yskoiju2e
ERROR: deployment failed: failing invoking action 'provision', error deploying infrastructure: deploying to subscription:
Deployment Error Details: DeploymentActive: Unable to edit or replace deployment 'container-apps': previous deployment from '7/7/2023 4:43:33 PM' is still active (expiration time is '7/14/2023 4:09:58 PM'). Please see https://aka.ms/arm-deploy-resources for usage details.
tried switching from cname to txt - tbf i think when i did it in the portal i used txt
new error is RequireCustomHostnameInEnvironment: Creating managed certificate requires hostname 'cnstlltn.ai' added as a custom hostname to a container app in environment 'cae-4a73yskoiju2e' not sure if above is the dependency everyone is talking about https://stackoverflow.com/questions/74804714/how-can-i-add-a-custom-domain-to-azure-container-app-via-bicep
got a new build error which is MissingRegistrationForLocation: The subscription is not registered for the resource type 'dnszones' in the location 'eastus'. Please re-register for this provider in order to have access to this location.
az provider register --namespace Microsoft.Network
finally failed but a certificate is showing
do decompiilng the umm stuff i have seen on azure portal
you can do it by exporting the resource and then doing az bicep decompile --file template.json
frustratingly there is no export for the container app... so i'll try again two ways once as before and once with http...
because to be fair the validation seems to time out for azure portal stuff as well - so werid.
so previously i was trying to delete the managed environment and the containers but maybe that isn't necessary actually as i can just delete the managed certificate bit which is taking agaes and i'm not quite sure what is doing - technically the deployment is active which is the prorlbem so okay that is some progress i'm learning stuff hmm
so read the discussion more carefully and actually teh certificate succeeded it jsut didn't tell anyone about it - so maybe i can now do the third step?
so i cancelled the deployment and the certificate is still there so that's good so maybe i can just try the third step as eveyrone suggests - the switch to http might have made the difference
Deployment Error Details: InvalidTemplateDeployment: The template deployment 'web-container-app-update' is not valid according to the validation procedure. The tracking id is '13aac6e9-560b-47e4-8f96-201ce186686a'. See inner errors for details. ValidationForResourceFailed: Validation failed for a resource. Check 'Error.Details[0]' for more information. ContainerAppInvalidSchema: Invalid request body for container app. Path: $. Does not conform to Container App schema, please visit for more information https://docs.microsoft.com/azure/container-apps/azure-resource-manager-api-spec?tabs=arm-template#container-app new error message when i add parent maybe there is a way to validate bicep code locally so you can do it with az bicep build --file infra\app\web.bicep etc. but doesn't seem to highlight any errors
so i somehow got it to work - not quite sure why
this was the key commit https://github.com/lao8n/cnstlltn/commit/080ba4624c46e77fec0714e6a5a58142bb07903e i think the harded code website was the key change - and possible the date change? i'm not sure hmm