Azure DevTest lab : ResourceGroupNotFound error - azure

I am trying to create a VM out of a custom image in dev test lab using az lab vm create .. command.
I end up getting an error :
Message: Resource group '.....' could not be found.
I made sure that the resource group name I am passing in, is the same as the one which is listed under "Resource Group" in the lab's Overview tab.
What am I doing wrong?

In this case the az was setup to use another subscription, changing the subscription fixed the issue

Related

Can't delete resource group from Azure Container App

I recently created inside one of my resource groups an Azure Container App (with an environment & the rest) just for learning reasons (at the West Europe region). After I played with that, I decided to delete it. I tried to delete it without any success from the portal.
Looking around in the portal I found out that a new resource group had been created with name MC_braverock-518cbd83-rg_braverock-518cbd83_westeurope. This resource group was never generated by me. It appears that inside it there are a public IP address, a NSG & 2 Kubernetes Load Balancers.
I tried then to delete that auto-generated (somehow) resource group but again with no success. I literarily can't even touch it. I tried to delete all resources one by one. Nothing again. I even issued the command az group delete --resource-group "MC_braverock-518cbd83-rg_braverock-518cbd83_westeurope" from inside the Azure Cloud Shell and it seems that the cli gets stuck in Running.... When I had issued the command from the portal it was still running for a whole hour. So, obviously something is going wrong.
I visited the page https://resources.azure.com/, then I visited that resource group and the Json in the resource group that returned is having the following:
"provisioningState": "Deleting".
Do you know how I can delete the resources & the resource group?
I am almost confident that this is not being deleted... :(
EDIT:
Trying to delete manually one of the Load Balancers in that resource group I get a message that the Load Balancer in that subscription can not be deleted as it is in use by a virtual machine scale set that it is on a totally different subscription (a subscription that I am not aware off).
To delete the resources and the resource group, you can try using Resource Explorer (azure.com) portal as there might be some dependencies to delete the resource group/resources.
You can try deleting the resources like below:
Go to Resource Explorer (azure.com) portal -> Click on your subscription -> Expand Resource groups -> Select your Resource Group
Expand Providers -> Microsoft.Network -> networkSecurityGroups -> Select your NSG -> Action(POST,DELETE) -> Delete
In my environment testnsg networkSecurityGroup deleted successfully in the Azure Portal.
You can try deleting the required Azure Resources by following the same process. If still, you are not able to delete the Azure resource Group try checking the child resources associated to that resource group.
I tried to reproduce the same in my environment and got the same error like below:
az network lb delete -g ResourceGroupName -n LoadBalancerName
The error "LoadBalancerUseByVirtualMachineScaleSet" usually occurs if backendpool is being used by any other resource.
To resolve the error, try executing below commands in CloudShell like below:
Delete the load balancer associated with the VMSS:
az vmss update --resource-group ResourceGroupName1 --name VmssName --remove virtualMachineProfile.networkProfile.networkInterfaceConfigurations[0].ipConfigurations[0].loadBalancerBackendAddressPools 0
Update the VMSS instance:
az vmss update-instances --instance-ids "*" -n VmssName -g ResourceGroupName1
Now, delete load balancer and it will be deleted successfully like below:
az network lb delete -g ResourceGroupName -n LoadBalancerName
Reference:
Update or delete an existing load balancer used by virtual machine scale sets - Azure Load Balancer
This is a side artifact of Container app managedEnvironment resource. You need to first delete the environment in order to get artifacts to get automatically removed.
As JJ mentioned, the MC_* resource group is created when you create ACAs with the internal configuration. You try to find whether you have any container app environments in your subscription. Could be that you created your test app in a wrong resource group and can't find it now. :)
Try deleting all container app envs this resource group will automatically be gone.

Azure CLI doesn't recognize resource group

So I'm new on Azure and got some problems with the CLI on the portal. After creating an AKS service using the UI, I cannot find it in the CLI and get an error message as shown below. Am I missing an obscure setting that filters resources? I can't even find my resource group.
Checked the spelling multiple times, obv.
Also checked this Resource not found..., which is again for very obscure queries, whereas mine is extremely simple.
Any help would be appreciated!
(ResourceGroupNotFound) Resource group 'WebPlatformResource' could not be found.
Code: ResourceGroupNotFound
Message: Resource group 'WebPlatformResource' could not be found.
Thank you #Niels Uitterdijk , As discussed i am posting it as an answer to help other community members for the similar issue .
Message: Resource group 'yourresourcegroup' could not be found.
The above error occurs if we have multiple subscriptions, set your subscription first and then try:
To list all subscriptions - az account list --output table
To set your subscription - az account set --subscription "My Demos"
For more information please refer this MS DOC .

How to deploy an Azure Bot

I have created a simple Azure Bot from a Typescript template from this tutorial. I have tested it in the Bot Framework Emulator and now want to deploy it to Azure. I am trying to follow the instructions here. I get as far as the step "Deploy via ARM template with existing resource group" (I have already created a Resource Group).
So I am trying to run this command from the command line:
az deployment group create --resource-group "<name-of-resource-group>" --template-file "<path-to-template-with-preexisting-rg.json>" --parameters appId="<app-id-from-previous-step>" appSecret="<password-from-previous-step>" botId="<id or bot-app-service-name>" newWebAppName="<bot-app-service-name>" existingAppServicePlan="<name-of-app-service-plan>" appServicePlanLocation="<region-location-name>" --name "<bot-app-service-name>"
I'm getting an error: az deployment: 'group' is not in the 'az deployment' command group. Sure enough when I look at the help for az deployment, there is no group command. There is a create command, but if I remove group I get into a series of other errors which just seem to lead me down a rabbit hole.
In my desperation, I tried installing the BotFrameworkComposer app (Linux) and to create a project from there. It gives me an error Error calling npm to fetch template. Please ensure that node and npm are installed and available on your system. Full error message: Command failed with ENOENT: npm root -g --prefix. So I tried opening the bot resource that I created in the Azure portal using the "Open in Composer" button and nothing opens. So I copied the link from the button into the browser (as it suggests) but the app doesn't open.
I'm getting an error: az deployment: 'group' is not in the 'az deployment' command group. Sure enough when I look at the help for az deployment, there is no group command.
What version is your AZ CLI?
I am using 2.27.2 and I have it.
C:\>az -v
azure-cli 2.27.2
core 2.27.2
telemetry 1.0.6
C:\>az deployment --help
Group
az deployment : Manage Azure Resource Manager template deployment at subscription scope.
Subgroups:
group : Manage Azure Resource Manager template deployment at resource group.
mg : Manage Azure Resource Manager template deployment at management group.
operation : Manage deployment operations at subscription scope.
sub : Manage Azure Resource Manager template deployment at subscription scope.
tenant : Manage Azure Resource Manager template deployment at tenant scope.
C:\>az deployment group --help
Group
az deployment group : Manage Azure Resource Manager template deployment at resource group.
Commands:
cancel : Cancel a deployment at resource group.
create : Start a deployment at resource group.
delete : Delete a deployment at resource group.
export : Export the template used for a deployment.
list : List deployments at resource group.
show : Show a deployment at resource group.
validate : Validate whether a template is valid at resource group.
wait : Place the CLI in a waiting state until a deployment condition is met.
what-if : Execute a deployment What-If operation at resource group scope.

Resource group with Azure AD Domain Service is not getting deleted

While trying to create Azure Virtual Desktop, I have created one resource group with Azure AD Domain Service to bind Active Directory with Virtual Network.
At the cleanup time, I tried to delete the resource group which contains the Azure AD Domain service.
I tried to delete the resource group from Portal as well as from Powershell. Using the following command -
Get-AzureRmResourceGroup -Name AADS | Remove-AzureRmResourceGroup -Verbose -Force
But I am receiving following error.
Cannot modify resource with id '/subscriptions//resourceGroups/AADS/providers/Microsoft.AAD/domainServices/' because the resource entity provisioning state is not terminal. Please wait for the provisioning state to become terminal and then retry the request.
I attempted delete operation multiple times with an interval of around 2-3 hours but still getting the same error.
This issue belongs to troubleshooting and was fixed by the Microsoft support team.
You can raise a support ticket on azure portal by following this link: https://learn.microsoft.com/en-us/azure/azure-supportability/how-to-create-azure-support-request

Creating Azure PAAS Resource within DevTestLab through repositories

I am not able to Create Azure Paas resource "VirtualMachineScaleSets" within DevTestLab, which i am trying by uploading ARM Template to DevtestLab repository through VSTS. It gives "Authorization failed for template resource of type 'Microsoft.Compute/VirtualMachineScaleSets' error
Overall goal is to create "Service fabric cluster" within DevTestLab
MSDN link : https://learn.microsoft.com/en-us/azure/devtest-lab/devtest-lab-create-environment-from-arm
Because DevTestLab is different with Azure resource module. For now, Azure does not support deploy VMSS to DevTestLab.
By the way, we can't use the same template to deploy resource in DevTestLab, there are different resource.
More information about DevTestLab template, please refer to this link.
We have a fix working its way through our safe deployment pipeline. The fix will be deployed soon to all regions.
As a work around you could give "VS Dev Test Lab" application "owner" permission at subscription level and "owner" permission to DevTestLab created.

Resources