<@UB39JFCKC>, looking at one example you posted, <...
# azure
w
@tall-librarian-49374, looking at one example you posted, https://github.com/pulumi/pulumi-azure-native/blob/ae7f380268c97b951a76848ec45b3bafa22d4338/examples/postgres/index.ts, is it the SKU that defines that it is a flexible server?
t
The important thing there is the
v20200214preview
API version
w
Can you elaborate on that? Is that the important part that makes it flexible server?
t
Yes. Flexible servers are defined only in that API version and they somehow are still called just “Server”, which makes the API look very confusing.
w
yeah, and the configuration part... what is that really? I guess I still need to add a database that uses that server.
t
You can ignore the configuration part if you don’t need it. It’s more of a test that it works for us.
w
ok, but what does it do? Will probably remove it 🙂
t
It… sets
backslash_quote
config to
on
🤷
w
haha, The deploy actually fails for me:
Copy code
Diagnostics:
  azure-native:dbforpostgresql/v20200214preview:Configuration (postgresserverconfig):
    error: cannot check existence of resource '/subscriptions/dc71fe64-b8cf-4d7e-97a3-454f11c2d182/resourceGroups/iac-docugen-dev-rg/providers/Microsoft.DBForPostgreSql/flexibleServers/postgresserver829af994/configurations/postgresserverconfig': status code 500, {"error":{"code":"InternalServerError","message":"An unexpected error occured while processing the request. Tracking ID: 'c5f5e772-fa6d-42c7-a22c-3ec643115716'"}}
The server is provisioned, but the config fails.
Seen that @tall-librarian-49374?
t
Huh, no, I don’t think I’ve seen that one - but this example isn’t run in our test suite unfortunately. It worked last time I tried.
w
ok, any ideas on how to figure out what's going on... I can see that the server was created.
When I try to create the db (removed the config) with
Copy code
new postgresql.Database("mydb", {
    resourceGroupName: resourceGroupName,
    serverName: flexibleServer.name,
    databaseName: "mydb",
    charset: "UTF8",
    collation: "SQL_Latin1_General_CP1_CI_AS",
}, azureOptions
)
I get
Copy code
azure-native:dbforpostgresql:Database (docugendb):
    error: Code="ResourceNotFound" Message="The Resource 'Microsoft.DBforPostgreSQL/servers/postgresserver829af994' under resource group 'iac-docugen-dev-rg' was not found. For more details please go to <https://aka.ms/ARMResourceNotFoundFix>"
I'm very sure that the server resource does exist, since I can connect to it and create the db myself... but I would rather have pulumi creating the db as well and not just the server.
t
It looks like you are creating a “non-flexible” database? I.e. a database on a non-flexible server ARM resource.
w
ah, so I need to use
v20200214preview
for the database as well? The
Database
resource doesn't exist there yet it seems. I just assumed that I could use the default
Database
resource and it would figure out what to do, but I understand if that is not the case.
t
ARM paths are different for servers vs flexible servers
But I don’t quite know how to define a database
w
strange. Can they have removed it for flexible? I clicked through the portal and the links there on how to create a db doesn't use ARM either. Might just use non-flexible then to have it properly provisioned.
@tall-librarian-49374, I guess this is because database for flexible server isn't in the ARM API yet, is that correct?
t
That’s my impression