The 2 commands
Set-AzureVnetConfig -ConfigurationPath $VNetCfgPath
New-AzureService -ServiceName $CloudServiceClassicName -AffinityGroup $AffinityGroup
create their own resource groups but I want them to create resource in a specific resource group already existing.
How can I do that?
Those cmdlets are from the Classic deployment model for Azure and thus do not understand the concept of a resource group.
Resource Manager Supported Services: https://learn.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-supported-services
Azure Resource Manager vs. classic deployment: https://learn.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-deployment-model
You should be able to move the new resources after the fact using Resource Manager cmdlets like
Move-AzureResourceGroup
. Going forward, I would recommend looking at migrating your resources over to the Azure Resource Manager deployment model unless you have a specific requirement tying you to the Classic model.