Azure / azure-sdk-for-net

This repository is for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/dotnet/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-net.
MIT License
5.35k stars 4.66k forks source link

[QUERY] Why are the C# CDK and SDK mixed together? #46347

Open garrettlondon1 opened 4 days ago

garrettlondon1 commented 4 days ago

Library name and version

Azure.Provisioning

Query/Question

It's unclear to me why the Azure.Provisioning libraries are mixed in with the Azure SDK libraries.

Defining Infrastructure as code (CDK) through C#, is in my opinion, very separate from the code I need to call Azure Key vault from my .NET Web API

Additionally, it's hard to tell what to use for resource groups, vnets not supported by Azure Provisioning. "Management" SDKs for Resource groups, etc. Are they idempotent like CDK's should be?

var client = new ArmClient(new AzureCliCredential());

string resourceGroupName = "alreadyexistsrg";
SubscriptionResource subscription = await client.GetDefaultSubscriptionAsync();
ResourceGroupCollection resourceGroups = subscription.GetResourceGroups();

AzureLocation location = AzureLocation.EastUS2;
ResourceGroupData resourceGroupData = new ResourceGroupData(location);
var rg = await resourceGroups.CreateOrUpdateAsync(WaitUntil.Completed, resourceGroupName, resourceGroupData);

Using this code, I am trying to use Azure Provisioning libraries and azd to deploy IAC through C#. It is not idempotent, it returns a 409 conflict saying my resource group already exists.

I have spent a while and cannot find any documentation that explains how to at the subscription level, create a resource group, add some resources using the Azure Provisioning libraries, and idempotently deploy it to Azure.

Am I missing any crucial documentation to get started here?

I do not want to use Aspire, I am running a monolithic service and do not need the local orchestration. I just want to use the CDK to deploy my resources to azure instead of bicep.

Environment

No response

github-actions[bot] commented 4 days ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @anthony-c-martin @calecarter @cemheren @j5lim @majastrz.

jsquire commented 4 days ago

@tg-msft and @ArthurMa1978: Would you please offer your thoughts?