I'm trying to figure out if i deploy something from my powershell, that it is deploying to the wrong subscription which is in no way connected to eachother, except for that i have previously been logged in with it in powershell.

I have used az logout and az account clear to make sure it doesn't have any knowledge of the other account.

If i list any resources it would do it on the correct account, but creating would be on the second account.

If i do a az account list it only shows the correct account.

Any ideas of how to fix this ?



For anyone else needing the answer, the AZ module the other modules are not working correctly together, as my context was set differently in AzureRM than in Az.

When i attempted to do the deployments through for an example az group create instead of new-azresourcegroup it deployed correctly


Try using the select command first, to select which tenant you are deploying to:

Select-AzureRmSubscription -SubscripitionID <ID of sub> -TenantId <ID of Azure Tenant>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.