I'm looking at this SDK to generate APIM subscription key in my c# application.
I couldn't find the right way to get the class instance ApiManagementSubscriptionResource and invoke this method CreateResourceIdentifier(String, String, String, String). Anyone can shed some light on how can I call the method to generate subscription key from my c# application?
SubscriptionResource subscription = await client.GetDefaultSubscriptionAsync();
ResourceGroupCollection resourceGroups = subscription.GetResourceGroups();
ResourceGroupResource resourceGroup = await resourceGroups.GetAsync("rg_name");
var apiManagements = await resourceGroup.GetApiManagementServiceAsync("apim_name");
You're close, you just have to keep going.
This worked for me ...
... you'll just need to work out your
Scope,SID,DisplayName, etc.I suspect you'll want the primary key after it's created if you need to communicate back to the caller once setup.
That can be obtained in the response ...