-
-
Save justinyoo/af93aeddf89df9627ec3ab2fa698ecce to your computer and use it in GitHub Desktop.
Application Insights WebTests SDK
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var resourceGroup = "RESOURCE_GROUP_NAME"; | |
var resource = new WebTestResource(...); | |
var identity = resource.ResourceIdentity; | |
using (var client = new ResourceManagementClient(credentials)) | |
{ | |
var result = client.Resources.CreateOrUpdateAsync(resourceGroup, identity, resource).ConfigureAwait(false); | |
if (result.StatusCode != HttpStatusCode.Ok && result.StatusCode != HttpStatusCode.Created) | |
{ | |
throw new HttpResponseException(result.StatusCode); | |
} | |
return result.Resource; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment