Closed AlexLsh closed 1 day ago
Thank you for your feedback. Tagging and routing to the team member best able to assist.
Hi @AlexLsh , Thank you for using Azure SDK for .Net.
I can't 100% go through your scenaro since we don' have much domain knowledge on a specific service. However, the usage of this method should looks like:
await resourceGroup.CreateOrUpdateConfigurationAssignmentAsync("Microsoft.Compute", "hostGroups/hostGroupName/hosts", "hostName", "resultName", data)
I can't get further beacuse the service returns region not supported error, but there should avoid the Not Found error thrown.
Hi @AlexLsh. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.
Hi @AlexLsh, we're sending this friendly reminder because we haven't heard back from you in 7 days. We need more information about this issue to help address it. Please be sure to give us your input. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!
Library name and version
Azure.ResourceManager.Maintenance v1.1.2
Describe the bug
It appears that the call to
CreateOrUpdateConfigurationAssignmentAsync()
behaves differently based on whether the resource type (as passed to that call) has parent/child resource types, like: "hostGroups/hosts" or when there's just a resource type name, like: "virtualMachines"For the virtual machine resource, when there's a resource missing (like a virtual machine not present in a RG), the error message would be:
The Resource 'Microsoft.Compute/virtualMachines/maintenanceconfigurationtest' under resource group 'fsavs3wcus-rupatro-mgmt' was not found.
Note the resource name looks like expected: Provider/Type/name.For the host resource, in the scenario when the required resource was actually present in an RG, the error message was:
The Resource 'Microsoft.Compute/hostGroups/hosts' under resource group 'fsavs3wcus-vis-proto-mgmt' was not found.
Note that the resource name (esx-1) is not present in the error message.It looks like
CreateOrUpdateConfigurationAssignmentAsync()
fails to understand, that 'Microsoft.Compute/hostGroups/hosts' is not a full resource name. And, when it tries to lookup with 'Microsoft.Compute/hostGroups/hosts' the resoource whose name is actually 'Microsoft.Compute/hostGroups/hosts/esx-1', it of course fails.Expected behavior
When called to add an existing Host resource the function should add it to the MC, just as
New-AzConfigurationAssignment
does. I was able to verify that theNew-AzConfigurationAssignment
would add the Hosts to the MCs in the resource groups, whereCreateOrUpdateConfigurationAssignmentAsync()
as describe above.Actual behavior
As describe above,
CreateOrUpdateConfigurationAssignmentAsync()
fails to add exisring Host to existing Maintenance Configuration (MC).Reproduction Steps
New-AzConfigurationAssignment
, andCreateOrUpdateConfigurationAssignmentAsync()
would fail as described in the Bug Description Section.Environment
An Azure Subscription.