I am migrating an app that uses Microsoft.Azure.Management.Dns to Azure.ResourceManager.Dns
Everything has been rewritten (not even close to a migration). In any event I got it all working with the exception of Metadata. The following code works well in the deprecated SDK.
RecordSet recordSetParams;
is where I add Metdata when using the deprecated SDK. Here’s a sample:
// Add metadata to the record set. Similar to Azure Resource Manager tags, this is optional and you can add multiple metadata name/value pairs
recordSetParams.Metadata = new Dictionary<string, string>
{
{ OUR_HOST_KEY, Environment.MachineName },
{ "Requestor-IPaddress", requestSourceIP },
{ "datetime", $"{DateTime.Now.ToShortDateString()}-{DateTime.Now.ToShortTimeString()}" }
};
...
recordSetParams.ARecords.Add(new ARecord(address));
... }
return recordSetParams;
}
I am unable to find an object reference I can use to store our Metadata in the new SDK. I checked every class I can find; several expose Metadata but they only have a getter, no setter.
DnsARecordCollection would seem to be the place to add the Dictionary but I can’t find it. GitHub Copilot is three years behind so it was little help. It always falls back to the old SDK.
I’m probably just looking in the wrong places. Any help you can provide will be greatly appreciated.