Azure / ResourceModules

This repository includes a CI platform for and collection of mature and curated Bicep modules. The platform supports both ARM and Bicep and can be leveraged using GitHub actions as well as Azure DevOps pipelines.
https://aka.ms/carml
MIT License
725 stars 456 forks source link

[Bug Report]: Hostpool API no longer returns registratrionInfo #3089

Open joshuadmatthews opened 1 year ago

joshuadmatthews commented 1 year ago

Describe the bug

I am using the AVD-Accelerator templates, but was trying to upgrade the HostPool API version because the version they use doesn't support the startVMOnConnect setting.

When I upgrade to the latest version, it no longer returns registrationInfo which is being used as an output and the auto generated token is passed to the extension that joings the VM to the HostPool.

The documentation that I can find is pretty scarce on how to use registrationInfo now. What is the suggested method for creating a HostPool and assigning a VM to it now?

https://github.com/Azure/avdaccelerator/issues/330

To reproduce

Run AVD-Accelerator templates but upgrade the hostpool to use the latest API.

Code snippet

No response

Relevant log output

{
    "status": "Failed",
    "error": {
        "code": "DeploymentOutputEvaluationFailed",
        "message": "Unable to evaluate template outputs: 'hostPoolRegistrationInfo'. Please see error details and deployment operations. Please see https://aka.ms/arm-common-errors for usage details.",
        "details": [
            {
                "code": "DeploymentOutputEvaluationFailed",
                "target": "hostPoolRegistrationInfo",
                "message": "The template output 'hostPoolRegistrationInfo' is not valid: Template parameter 'hostPoolRegistrationInfo' was provided an invalid value. Expected a value of type 'Object', but received a value of type 'Null'. Please see https://aka.ms/arm-create-parameter-file for usage details.."
            }
        ]
    }
}
rahalan commented 1 year ago

@joshuadmatthews Needs further investigation. According to the latest API 2022-09-09, it should still return it. The plain vanilla CARML module does not have it in the outputs. Maybe it was a custom change to the CARML module. But it still should work.

AlexanderSehr commented 1 year ago

Hey @joshuadmatthews, I think the output never existed in the CARML module, but the team behind the AVD accelerator added it on their part. I guess it makes sense to also add it to our module. In any case, the error you describe sounds like that the provider has an error, which is odd. At least for the API version 2022-02-10 seems to still return it. Maybe it is only an issue with the 09 version. On the CARML-side we're unfortunately as dependend on the providers as everybody else. If it's an actual provider issue we can try to pass this on to the PG.

joshuadmatthews commented 1 year ago

Ok, let me try 2022-02-10 and see if I have any better luck. Will get back to you shortly.

joshuadmatthews commented 1 year ago

Same result with 2022-02-10-preview, still works for me on version AVDAccelerator was using 2019-12-10-preview. Seems like a provider issues.

I think passing this on to the PG would be beneficial. At least to find out if this is some purposeful change or if something isn't working as expected with the newer APIs.

joshuadmatthews commented 1 year ago

I did discover that I can set startVMOnConnect with the older API though, so at least I can keep using that for now.

rahalan commented 1 year ago

Needs to be forwarded to PG.

rahalan commented 1 year ago

Ping @danycontre. Can you help here? Thanks!

danycontre commented 1 year ago

Hey folks, never got this notification.

We modified the CARML module to include an output with the registration token, but in new APIs this is no longer available, PG's insights were that this was done for security reasons (makes sense).

For the AVD LZA we end up using CARML API version (2022-09-09) to create the host pool and then using a different older API (2019-12-10-preview) to get host pool registration token.

We still need to go back to the PG team and check how should we proceed on this.