billions-carpet-89629
09/20/2021, 7:22 AMusing ApiManagement = Pulumi.AzureNative.ApiManagement.V20210101Preview;
...
var operation2 = new ApiManagement.ApiOperation($"{apiName}/send",
new ApiManagement.ApiOperationArgs
{
ApiId = api.Id,
ResourceGroupName = resourceGroup.Name,
ServiceName = apiManagementService.Name,
DisplayName = "send",
Method = "GET",
OperationId = Output.Format($"{apiManagementService.Name}/PushNotificationApi/send"),
UrlTemplate = "/send",
TemplateParameters = new InputList<ParameterContractArgs>(),
Responses = new InputList<ApiManagement.Inputs.ResponseContractArgs>()
});
It fails with an error:
error: autorest/azure: error response cannot be parsed: "" error: EOF
I could deploy it only via ARM Template deployment:
var operation = CreateApiOperation($"{apiName}/push",
new ApiManagement.ApiOperationArgs
{
ApiId = api.Id,
ResourceGroupName = resourceGroup.Name,
ServiceName = apiManagementService.Name,
DisplayName = "Push",
Method = "GET",
//OperationId = Output.Format($"{apiManagementService.Name}/PushNotificationApi/push"),
UrlTemplate = "/push",
TemplateParameters = new InputList<ParameterContractArgs>(),
Responses = new InputList<ApiManagement.Inputs.ResponseContractArgs>()
});
...
private Output<string> CreateApiOperation(string name, ApiManagement.ApiOperationArgs args)
{
var deployment = new AzureNative.Resources.Deployment($"deployment",
new AzureNative.Resources.DeploymentArgs
{
DeploymentName = Output.Format($"deployment_operation_{args.DisplayName}"),
Properties = new AzureNative.Resources.Inputs.DeploymentPropertiesArgs
{
Mode = DeploymentMode.Incremental,
Template = new Dictionary<string, object>()
{
{
"$schema",
"<http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#>"
},
{"contentVersion", "1.0.0.0"},
{"parameters", new Dictionary<string, object>()},
{
"resources", new[]
{
new Dictionary<string, object>()
{
{"type", "Microsoft.ApiManagement/service/apis/operations"},
{"apiVersion", "2021-01-01-preview"},
{"name", Output.Format($"{args.ServiceName}/{name}")},
{
"properties", new Dictionary<string, object>()
{
{"displayName", args.DisplayName},
{"method", args.Method},
{"urlTemplate", args.UrlTemplate},
{"templateParameters", args.TemplateParameters},
{"responses", args.Responses}
}
}
}
}
}
},
},
ResourceGroupName = args.ResourceGroupName,
});
return null;
}
I suspect the problem is in OperationId. I tried all possible combinations. I appreciate any help. Thanks a lot.