-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Set-AzIoTDeviceProvisioningServiceCertificate incorrectly passes the certificate as the query parameter 'certificate.name' instead of the body's member certificate.rawBytes #26669
Comments
After playing with every setting I can think to adjust, I have come to the conclusion that there is no way to use this command as-is. I attempted to upload the verification certificate and then pass that as the |
I have a change which compiles. I assume it will work, but am not at all familiar with Powershell and Powershell cmdlets so I am trying to figure out how to build and test these changes. I was able to do a
|
OK. That does not work.
That does not work. |
I have not been able to get any restful calls without a body of My management has indicated that I have spent too much time on this already and we need to just use the restful api directly and abandon azure powershell. That said, you still have a problem and the fact that you have not detected that you have a problem indicates your testing has a problem as well. |
Description
When I invoke:
I see the Restful API call is taking the body of the certificate and assigning it to the certificate.name query parameter.
The following was referencing git commit 174cc61.
Working back from the code which assembles the query string, I see:
In
DeviceProvisioningServices.Management.Sdk/Generated/DpsCertificateOperations.cs
:This tells me that the passed in parameter 5 (certificatename), not to be confused with the parameter 1 (certificateName), is being passed in as a string. What I intend to do is pass in parameter 6 (certificaterawBytes) as the body of my certificate.
Tracking back to the call location, I see:
DeviceProvisioningServices.Management.Sdk/Generated/DpsCertificateOperationsExtensions.cs:
That, in turn is called from:
Cmdlet/IotDpsCertificates/SetAzureRmIotDeviceProvisioningServiceCertificate.cs
And just for completness:
DeviceProvisioningServices.Management.Sdk/Generated/Models/VerificationCodeRequest.cs
Conclusion:
No matter what I pass to the
Set-AzIoTDeviceProvisioningServiceCertificate
command, it will be converted to a string in SetAzureRmIoTDeviceProvisioningServiceCertificate by lines 162-167.That, in-turn will cause VerifyCertificate to receive what I am passing as a certificate in the certificatename parameter, which is in-turn passed to VerifyCertificateAsync as the certificatename parameter, which in turn is passed to VerifyCertificateWithHttpMessagesAsync as its certificatename parameter, resulting in the wrong query string.
Issue script & Debug output
Environment data
Module versions
Error output
The text was updated successfully, but these errors were encountered: