Azure / azure-sdk-for-net

This repository is for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/dotnet/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-net.
MIT License
5.17k stars 4.53k forks source link

Getting "NOT_SET" in LRO rehydration token value for azure.resourcemanager.resources #44866

Open RoLfBOT opened 5 days ago

RoLfBOT commented 5 days ago

Describe the issue or request While initiating an ARM template deployment in a resource group with WaitUntil.Started, the GetRehydrationToken() is having value "NOT_SET".

Azure.ResourceManager.Resources 1.7.3

var armClient = new ArmClient(new ChainedTokenCredential(new AzureCliCredential(), new DefaultAzureCredential()), "mysubscriptionId");
var subscription = await armClient.GetDefaultSubscriptionAsync();
var resourceGroup = await subscription.GetResourceGroupAsync("myresourcegroup");
var armDeployment = await resourceGroup.Value.GetArmDeployments().CreateOrUpdateAsync(
  waitUntil: WaitUntil.Started,
  "testRehydration",
  content: new ArmDeploymentContent(new ArmDeploymentProperties(ArmDeploymentMode.Incremental)
  {
    TemplateLink = new ArmDeploymentTemplateLink()
    {
      Uri = new Uri("<URI-of-template>")
    },
    Parameters = BinaryData.FromObjectAsJson(new JsonObject()
    {
      {
        "myParameter", new JsonObject() {
          { "value", "myParameterValue" }
        }
      }
    })
  })
);

var rehydrationToken = armDeployment.GetRehydrationToken();

Describe your ideas for solutions N/a

Add labels

live1206 commented 3 days ago

This should have been fixed in https://github.com/Azure/azure-sdk-for-net/issues/44097. We just need to release a new version for Azure.ResourceManager.Resources to roll out the fix.

live1206 commented 3 days ago

@RoLfBOT To be clear, "NOT_SET" is not for the rehydraitonToken itself, rehydrationToken.Id is NOT_SET, right?

RoLfBOT commented 2 days ago

@live1206 that's correct. My bad should have specified.