Hi
Christopher Clark •,
I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to "Accept " the answer.
Issue:
Solution in Customer Verbatim:
Update, I think I finally figured it out. I was getting stuck because I was confusing a Sql Server with a Sql Database and not properly understanding the resource hierarchy.
public async Task CreateDatabase(string name, string poolId) { var client = GetClient(); var resourceGroup = client.GetDefaultSubscription().GetResourceGroup("xxx-xxx").Value; var server = await resourceGroup.GetSqlServerAsync("xxx-xxx"); var pool = await server.Value.GetElasticPoolAsync(poolId); var sqlDatabaseData = new SqlDatabaseData(Azure.Core.AzureLocation.CentralUS); sqlDatabaseData.ElasticPoolId = new Azure.Core.ResourceIdentifier(pool.Value.Id); var result = await server.Value.GetSqlDatabases().CreateOrUpdateAsync(Azure.WaitUntil.Completed, name, sqlDatabaseData);
If you have any other questions or are still running into more issues, please let me know.
Thank you again for your time and patience throughout this issue.
Please remember to "Accept Answer" if any answer/reply helped, so that others in the community facing similar issues can easily find the solution.