Reputation: 5313
I've been using the Microsoft.Azure.Management.Fluent packages to create a tool that will build out my environment and do some additional setup. Now, I need to add an API Management instance. I don't see anything related to API Management in the Fluent SDK. I'm assuming there's no SDK wrapper for it and I just need to make the REST calls myself. I'm looking for a guide.
Upvotes: 1
Views: 570
Reputation: 29950
Currently, API Management
is not supported in the Fluent api
. Here is an issue about this.
Instead, there is another package Microsoft.Azure.Management.ApiManagement 6.0.0-preview, you can use it to create API Management instance
. The code like below:
// you should provide the real credentialhere.
ApiManagementClient client = new ApiManagementClient(the_credential);
//provide the neccesary parameters to create the APIM instance.
client.ApiManagementService.CreateOrUpdate(the_parameters);
Another way to create API Management
is by using this api: Api Management Service - Create Or Update. You can read the api doc for its usage and examples.
Upvotes: 3
Reputation: 3937
You can do it with REST:
Deployments - Create Or Update
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}?api-version=2020-06-01
You have to pass the link to your ARM Template in the Request-Body:
{
"properties": {
"templateLink": {
"uri": "https://example.com/exampleTemplate.json"
},
"parameters": {},
"mode": "Complete",
"onErrorDeployment": {
"type": "SpecificDeployment",
"deploymentName": "name-of-deployment-to-use"
}
}
}
You can store the ARM Template in Blob Storage and reference it in the Body.
Please find a sample API-Management ARM Template on GitHub - azure-quickstart-templates
Upvotes: 1