Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix Invalid DNS Zone caused by tailing newline characters #23

Merged

Conversation

jm-x1n09
Copy link
Contributor

@jm-x1n09 jm-x1n09 commented Aug 14, 2022

It took me several hours to debug Invalid DNS Zone exception, and finally I realized that multi-line command in PowerShell attached a newline character to the value of --azure-dns-zone.

(It was the line --azure-dns-zone /subscriptions/********-****-****-****-************/resourceGroups/***/providers/Microsoft.Network/dnszones/***.com` that involves newline to option.DnsZoneResourceId

./az-acme.exe order `
>>         --server https://acme-v02.api.letsencrypt.org/directory `
>>         --key-vault-uri https://***.vault.azure.net/ `
>>         --certificate ***-acme-certificate `
>>         --subject "***.com" `
>>         --sans "1.***.com" `
>>         --account-secret ***-amce-registration `
>>         --dns-provider Azure `
>>         --azure-dns-zone /subscriptions/********-****-****-****-************/resourceGroups/***/providers/Microsoft.Network/dnszones/***.com` ###
>>         --renew-within-days 180 `
>>         --verbose
DBUG: Loading Azure Credentials from environment...
DBUG: Creating Azure Key Vault secret client...
DBUG: Creating Azure Key Vault certificate client...
DBUG: Creating ACME provider instance...
***-acme-certificate
INFO: Loading metadata from certificate store for certificate '***-acme-certificate'.
INFO: Certificate '***-acme-certificate' does not exist in the certificate store.
┌───────────────┬───────────────────────────┬──────────────┬────────┐
│ Subject       │ Subject Alternative Names │ Expiry (UTC) │ Action │
├───────────────┼───────────────────────────┼──────────────┼────────┤
│  ***.com      │    1.***.com              │ -            │ Order  │
└───────────────┴───────────────────────────┴──────────────┴────────┘
INFO: Obtaining credentials to ACME Provider from Azure Key Vault.
INFO: Initiating order to ACME provider.
INFO: Updating DNS challenge records.
DBUG: Getting DNS Client Token from AAD...
Invalid DNS Zone. All Subjects and SANs must be part of the same DNS Zone.

@ross-mcdermott
Copy link
Contributor

Thanks for the contribution @jm-x1n09 - merged! 🎉 👏

@ross-mcdermott ross-mcdermott merged commit 11b65b4 into az-acme:main Aug 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants