Azure-Samples / azure-health-data-and-ai-samples

Samples for using the Azure Health Data Services
Other
46 stars 30 forks source link

Running azd up, fails on Azure API Management update #96

Closed muthink closed 1 year ago

muthink commented 1 year ago

(x) Failed: Azure API Management: azurefhirdev-apim

Everything else succeeded.

Details: ERROR: deployment failed: failing invoking action 'provision', error deploying infrastructure: deploying to subscription:

Deployment Error Details: ServiceAlreadyExistsInSoftDeletedState: Api service azurefhirdev-apim was soft-deleted. In order to create the new service with the same name, you have to either undelete the service or purge it. See https://aka.ms/apimsoftdelete. ResourceNotFound: The Resource 'Microsoft.ApiManagement/service/azurefhirdev-apim' under resource group 'azurefhirdev-rg' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix

TraceID: 70ac93971373267d70fd1ad083f5738b

Cannot follow instructions on how to soft-delete, or always fails.

muthink commented 1 year ago

I've managed to manually purge the apim, with an unacceptable level of difficulty, which is clearly a tooling oversight. This may have been because I waited so long between updates and this issue no longer exists. For future reference, this command lists the pending deletion, so you can find it: az rest --method get --header "Accept=application/json" -u 'https://management.azure.com/subscriptions/{subscription-id}/providers/Microsoft.ApiManagement/locations/{location}/deletedservices' Then you plug it in to an az rest --method delete... Now I am getting a different error: ERROR: deployment failed: failing invoking action 'provision', error deploying infrastructure: deploying to subscription:

Deployment Error Details: ResourceNotFound: Tenant not found.

TraceID: 4a9c327a588b5c0fbbe989ff0f09d49f

This may have to do with a change in one of the environment names or a failure to select the tenant when logging in.

muthink commented 1 year ago

A second login and azd up succeeded. Who issue could be because the apim update failed a step, causing me to attempt to delete it. Perhaps this "Reassignment" step in the APIM update will not happen in the future. But if it does, there is a way to just delete the APIM, purge it, and update, only its quite difficult.