fast-vr-6049
07/17/2023, 10:42 PMvar dnsZone = Zone.Get(
name: dnsZoneResourceId.Split('/').Last(),
id: dnsZoneResourceId
);
But this code throws an error when I run `pulumi preview`:
error: Preview failed: autorest/azure: Service returned an error. Status=400 Code="NoRegisteredProviderFound" Message="No registered resource provider found for location 'global' and API version '2023-07-01-preview' for type 'dnszones'. The supported api-versions are '2015-05-04-preview, 2016-04
-01, 2017-09-01, 2017-09-15-preview, 2017-10-01, 2018-03-01-preview, 2018-05-01'. The supported locations are ', global'."
That last supported locations
bit being ', global'
smacks of a typo to my sensibilities (global
!= , global
). I'm not sure if that typo was caused by Pulumi's automated consumption and parsing of the Azure API spec, or if someone over at Azure goofed when writing it.
This is further frustrated by trying to go back to using the API version that 1.x used. When hovering over Zone
, the doc comment mentions that the API version used in 1.x was 2018-05-01
, but Pulumi.AzureNative.Network.V20180501
does not have a Zone
resource defined in it. Indeed, it has very little in it at all; just four methods:
GetDnsResourceReferenceByTarResources
GetDnsResourceReferenceByTarResourcesArgs
GetDnsResourceReferenceByTarResourcesInvokeArgs
GetDnsResourceReferenceByTarResourcesResult
On a similar note, these previous version comments might be in need of some checking. For example, the VirtualNetwork
resource mentions that the previous version it used was 2020-11-01
, but Pulumi.AzureNative.Network.V20201101
doesn't even exist!
As it stands, it seems I am unable to migrate to Azure Native 2.0. Does anyone have suggestions for workarounds? Or perhaps are any of these problems I've listed worthy of filing issues in the Azure Native Github repo? Cheers!
Update: I have happened upon a truly cursed potential workaround 🧵fast-vr-6049
07/18/2023, 12:40 AMGet
method, and saw the third argument, the CustomResourceOptions
. Inside there is a Version
field, which the Docs say you should never edit. However, this was the only way I could find that would let me specify the version of the API to use, so I plugged it in:
var dnsZone = Zone.Get(
dnsZoneResourceId.Split('/').Last(),
dnsZoneResourceId,
new ()
{
Version = "1.104.0"
}
);
Lo and behold, it seems to work. The DNS zone is read correctly and appropriately passed on to the other resources. I cannot in good faith recommend anyone actually do this, as it may have consequences I haven't yet encountered. But if, like me, you're desperate to get back to working order, you can give it a try?rough-morning-53309
07/19/2023, 2:41 PMfast-vr-6049
07/20/2023, 7:13 PM