Example #1
0
        public async Task DeleteResourceGroupTest()
        {
            // SET PARAMETERS
            var baseUriString          = Environment.GetEnvironmentVariable("AZURE_BASE_URL");
            var resourceGroupName      = Environment.GetEnvironmentVariable("AZURE_RESOURCEGROUP");
            var servicePrincipalId     = Environment.GetEnvironmentVariable("AZURE_CLIENT_ID");
            var servicePrincipalSecret = Environment.GetEnvironmentVariable("AZURE_CLIENT_SECRET");
            var azureResourceId        = Environment.GetEnvironmentVariable("AZURE_RESOURCE_ID");
            var tenantId       = Environment.GetEnvironmentVariable("AZURE_TENANT_ID");
            var subscriptionId = Environment.GetEnvironmentVariable("AZURE_SUBSCRIPTION_ID");
            var credentials    = new CustomLoginCredentials(servicePrincipalId, servicePrincipalSecret, azureResourceId, tenantId);

            // SET CONTROLLER
            var resourceController = new ResourcesController(new Uri(baseUriString), credentials, subscriptionId);

            // DELETE RESOURCE GROUP
            var resourceGroup = await resourceController.DeleteResourceGroup(resourceGroupName);

            // VALIDATION
            Assert.True(resourceGroup.IsSuccessStatusCode);
        }