Open wahidsaleemi opened 1 year ago
Please upgrade to the latest code and try again first. Maybe it's already fixed. acme.sh --upgrade
If it's still not working, please provide the log with --debug 2
, otherwise, nobody can help you.
Added debug log to original post
When using the Managed Identity option (instead of Service Principal), the VM must have rights on the Azure DNS Zone. If this VM is not hosted in Azure, the Instance Metadata Service will be different and will not be able to get credentials needed for it's Managed Identity. For a VM in Azure, it is http://169.254.169.254/metadata/. If the VM is on-premises (for example) and is Arc-enabled so that it's Managed Identity can be used, the Instance Metadata Service is at http://localhost:40342/metadata/. See this documentation.
Steps to reproduce
export AZUREDNS_SUBSCRIPTIONID="<your subscription>"; export AZUREDNS_MANAGEDIDENTITY=true
acme.sh --issue --dns dns_azure --dnssleep 10 --force -d domain.com --staging
Debug log
acme.sh.log
Potential solution
A solution is to modify the
_azure_getaccess_token()
function in dns_azure.sh within the existing code block forif [ "$managedIdentity" = true ]; then
.I have tested this on my on-premises proxmox server. I did not submit a pull request because I don't know of a good way to check if the machine is running in Azure or if it's Arc-enabled.