-
Notifications
You must be signed in to change notification settings - Fork 4k
Command is not correct #12052
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
Merged
Merged
Command is not correct #12052
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
We can use this command for secret not certificates because this command is not correct for certificates of KeyVault. When we use this command, the id will be below. I think this id is not correct for AppGW. https://xxxxx.vault.azure.net:443/certificates/xxxx/ The should be below. "KeyVaultSecretId": "https://xxxx.vault.azure.net:443/secrets/xxxx/" When I used below command, I encountered error. $secretId = $secret.Id.Replace($secret.Version, "") "Set-AzApplicationGateway : SecretId 'https://xxxx.vault.azure.net:443/certificates/selftest/' specified in '/subscriptions/xxxxxxxxx/resourceGroups/apgw/p roviders/Microsoft.Network/applicationGateways/AppGW/sslCertificates/SelfKeyCert' is invalid." When I used below command, the operation was successful. So I think this document is not correct. $secretId = $certificate.SecretId.Replace($certificate.Version, "")
Can one of the admins verify this patch? |
VeryEarly
reviewed
Jun 4, 2020
@@ -37,7 +37,7 @@ This command gets an application gateway named ApplicationGateway01 and then add | |||
``` | |||
PS C:\> $AppGW = Get-AzApplicationGateway -Name "ApplicationGateway01" -ResourceGroupName "ResourceGroup01" | |||
PS C:\> $secret = Get-AzKeyVaultCertificate -VaultName "keyvault01" -Name "sslCert01" | |||
PS C:\> $secretId = $secret.Id.Replace($secret.Version, "") # https://<keyvaultname>.vault.azure.net/secrets/ | |||
PS C:\> $secretId = $certificate.SecretId.Replace($certificate.Version, "") # https://<keyvaultname>.vault.azure.net/secrets/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you point me where "$certificate" was defined?
Sorry, I didn't write some commands.
$certificate = Get-AzKeyVaultCertificate -VaultName $kv -Name "cert1" $secretId = $certificate.SecretId.Replace($certificate.Version, "")
I got it from below document.
https://docs.microsoft.com/en-us/azure/application-gateway/configure-keyvault-ps
…--- [email protected] wrote:
@VeryEarly commented on this pull request.In src/Network/Network/help/Add-AzApplicationGatewaySslCertificate.md:> @@ -37,7 +37,7 @@ This command gets an application gateway named ApplicationGateway01 and then add```PS C:\> $AppGW = Get-AzApplicationGateway -Name "ApplicationGateway01" -ResourceGroupName "ResourceGroup01"PS C:\> $secret = Get-AzKeyVaultCertificate -VaultName "keyvault01" -Name "sslCert01"-PS C:\> $secretId = $secret.Id.Replace($secret.Version, "") # https://<keyvaultname>.vault.azure.net/secrets/+PS C:\> $secretId = $certificate.SecretId.Replace($certificate.Version, "") # https://<keyvaultname>.vault.azure.net/secrets/can you point me where "$certificate" was defined?—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
This command is correct. $secretId = $secret.SecretId.Replace($secret.Version, "")
I made a mistake. This is corrct. Before $secret.Id.Replace($secret.Version, "") After $secret.SecretId.Replace($secret.Version, "") The Reason. If we use below command, the URL will be "/certificates/" and it's invalid URL for AppGW. $secretId = $secret.Id.Replace($secret.Version, "") > $secretId https://testxxxx.vault.azure.net:443/certificates/testself/ So below command is correct. $secretId = $secret.SecretId.Replace($secret.Version, "") > $secretId https://testxxxxxx.vault.azure.net:443/secrets/testself/
VeryEarly
approved these changes
Jun 5, 2020
VeryEarly
approved these changes
Jun 5, 2020
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We can use this command for secret not certificates because this command is not correct for certificates of KeyVault. When we use this command, the id will be below. I think this id is not correct for AppGW.
https://xxxxx.vault.azure.net:443/certificates/xxxx/
The should be below.
"KeyVaultSecretId": "https://xxxx.vault.azure.net:443/secrets/xxxx/"
When I used below command, I encountered error.
$secretId = $secret.Id.Replace($secret.Version, "")
"Set-AzApplicationGateway : SecretId 'https://xxxx.vault.azure.net:443/certificates/selftest/' specified in '/subscriptions/xxxxxxxxx/resourceGroups/apgw/p
roviders/Microsoft.Network/applicationGateways/AppGW/sslCertificates/SelfKeyCert' is invalid."
When I used below command, the operation was successful. So I think this document is not correct.
$secretId = $certificate.SecretId.Replace($certificate.Version, "")
Description
Checklist
CONTRIBUTING.md
ChangeLog.md
file(s) has been updated:ChangeLog.md
file can be found atsrc/{{SERVICE}}/{{SERVICE}}/ChangeLog.md
## Upcoming Release
header -- no new version header should be added