I recently migrated to the new major version of th...
# azure
e
I recently migrated to the new major version of the Azure Native provider and was facing issues with Azure Cosmos DB for PostgreSQL roles. To solve the issue I wanted to use a different API version to create the resource and for that I wanted to use the generic resource described in the Azure Native version guide. But I am encountering issues with it, see thread for more information
I first tried the import command here azure-native.resources.Resource but then I only get
Copy code
pulumi import 'azure-native:resources:Resource' myresource1 /subscriptions/xxx-yyyy-zzz/resourceGroups/rg1/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/db1/roles/role1
Copy code
azure-native:resources:Resource (myresource1):
    error: Preview failed: Status=400 Code="NoRegisteredProviderFound" Message="No registered resource provider found for location 'swedencentral' and API version '2024-03-01' for type 'serverGroupsv2'.
And when I tried to use the create using:
Copy code
var role = new Pulumi.AzureNative.Resources.Resource("role-1", new()
{
  ResourceGroupName = "rg1",
  ResourceProviderNamespace = "Microsoft.DBforPostgreSQL",
  ResourceType = "roles",
  ApiVersion = "2022-11-08",
  ParentResourcePath = Output.Format($"serverGroupsv2/db1"),
  Properties = new Dictionary<string, object?>
  {
    ["password"] = password,
    ["clusterName"] = db1,
    ["resourceGroupName"] = rg1,
    ["roleName"] = username,
  },
});
I get:
Copy code
error: cannot check existence of resource '/subscriptions/xxx-yyyy-zzz/resourceGroups/rg1/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/db1/roles/role1': status code 400, {"error":{"code":"NoRegisteredProviderFound","message":"No registered resource provider found for location 'swedencentral' and API version '2024-03-01' for type 'serverGroupsv2'.
Do anyone know how to solve this issue? I do not want to the "Local packages" solution Using azure native 3.1.0 pulumi version v3.162.0
The issue with the Azure Cosmos DB for PostgreSQL and its roles were several: • Could not update the azureApiVersion field for the role resource (that is bumped with the new azure-native version) due to
Role already exists. Create/Update operations are not supported for an existing AzureAD role.
• Introduction of two new required input variables to the ServerGroupRoleArgs compared to the old _RoleArgs_: objectId and principalType. First they have no documentation in the Pulumi docs. If they are specified as empty strings we get that "`AzureAD Authentication is not enabled for this server.`" and since ServerGroupCluster AuthConfig does not seem to work we are not able to enable AAD Authentication for the cluster.
t
Do you know where
2024-03-01
is coming from?
e
I assume that it is coming from the API version for the azure-native.resources.Resource
t
Aha! That doesn't sound right. Mind opening an issue?
e
Sure I can create one 👍