Problem solved thanks to Azure support. The storage size was missing. According to arm template:
https://learn.microsoft.com/en-us/azure/postgresql/flexible-server/quickstart-create-server-arm-template?tabs=portal%2Cazure-portal#review-the-template
Thank you @Oury Ba-MSFT
Create postgresql flexible server with netcore 6 and azure sdk
Hi, I have a problem with the creation of a postgresql flexible server using .net core 6.
The request seems to be correct. But looking on azure portal on activity log session, it always gave me this generic error:
Operation name: Update PostgreSQL Server Create
Error code: ResourceOperationFailure
Message: The resource operation completed with terminal provisioning state 'Failed'.
and, at code side this exception's message:
Long running operation failed with status 'Failed'.
Additional Info:'An unexpected error occured while processing the request.
Tracking ID: 'a3149cf8-b453-451b-807c-e91b62e5ef85'
I don't understand where the problem can be. Is there a way to get more details on the error? I think this is a too generic error.
Regarding my implementation, I generate the azure client using the class from azure sdk: Microsoft.Azure.Management.PostgreSQL.FlexibleServers.PostgreSQLManagementClient:
var credentials = SdkContext.AzureCredentialsFactory.FromServicePrincipal(clientId, clientSecret, tenantId, AzureEnvironment.AzureGlobalCloud);
var client = new PostgreSQLManagementClient(credentials, new HttpClientHandler ());
client.SubscriptionId = subscriptionId;
var response = await client.Servers.CreateWithHttpMessagesAsync(
data.ResourceGroupName,
"servername",
new Microsoft.Azure.Management.PostgreSQL.FlexibleServers.Models.Server
(
location: "northeurope",
sku: new Microsoft.Azure.Management.PostgreSQL.FlexibleServers.Models.Sku("Standard_D4s_v3", "GeneralPurpose"),
administratorLogin: data.AdministratorLogin,
administratorLoginPassword: data.AdministratorLoginPassword,
version: "13"
), null, CancellationToken.None
);
This code causes an exception, with the error message mentioned above.
1 answer
Sort by: Most helpful
-
Franz 21 Reputation points
2022-03-01T09:30:27.52+00:00