Closed figglewatts closed 1 year ago
Hey, this looks good, definitely should have used DefaultAzureCredential when they updated the DNS library.
The only issue I could see with this would be if lets say the VM had 2 user assigned identities, would it still work? Could you test that scenario. If its all good, happy to merge.
If you feel this is still relevant and can test that scenario I mentioned feel free to re-open this
This PR adds
DefaultAzureCredential
as a fallback in case no authentication method is configured in the INI file.To implement this, I have:
_validate_credentials()
, as having no configuration is now valid._get_azure_credentials()
fromManagedIdentityCredential
toDefaultAzureCredential
, asDefaultAzureCredential
will attempt to useManagedIdentityCredential
anyway and this gets us a bunch of other authentication methods essentially for free (such as Azure CLI, shared token cache, Azure Powershell etc).Looking forward to seeing what you think :)