.define(newHost.hostVM.resourceGroupName) .withRegion(newHost.hostVM.region) .create();
.create(); PolicyAssignment assignment = resourceManager.policyAssignments().define("assignment1") .forResourceGroup(group)
.define(rgName) .withRegion(rgRegion) .create();
/** * Create Azure resource Group. * * @param azureClient * @param locationName * @param resourceGroupName */ private void createAzureResourceGroup( Azure azureClient, String locationName, String resourceGroupName) throws AzureCloudException { try { azureClient.resourceGroups() .define(resourceGroupName) .withRegion(locationName) .create(); } catch (Exception e) { throw AzureCloudException.create( String.format( " Failed to create resource group with group name %s, location %s", resourceGroupName, locationName), e); } }
@Override protected void initializeClients(RestClient restClient, String defaultSubscription, String domain) { testId = SdkContext.randomResourceName("", 9); rgName = "rg" + testId; newRgName = "rgB" + testId; super.initializeClients(restClient, defaultSubscription, domain); resourceGroups = resourceClient.resourceGroups(); genericResources = resourceClient.genericResources(); resourceGroups.define(rgName) .withRegion(Region.US_EAST) .create(); resourceGroups.define(newRgName) .withRegion(Region.US_SOUTH_CENTRAL) .create(); }
@Override protected void initializeClients(RestClient restClient, String defaultSubscription, String domain) { super.initializeClients(restClient, defaultSubscription, domain); testId = SdkContext.randomResourceName("", 9); resourceGroups = resourceClient.resourceGroups(); rgName = "rg" + testId; resourceGroup = resourceGroups.define(rgName) .withRegion(Region.US_SOUTH_CENTRAL) .create(); }
@Override protected void initializeClients(RestClient restClient, String defaultSubscription, String domain) { testId = SdkContext.randomResourceName("", 9); rgName = "rg429" + testId; super.initializeClients(restClient, defaultSubscription, domain); resourceGroups = resourceClient.resourceGroups(); rg = resourceGroups.define(rgName) .withRegion(Region.US_EAST) .create(); }
@Override public ResourceGroup internalCreate(String key) { return azure.resourceGroups().define(key).withRegion(azureProperties.getRegion()).create(); } }