Is there a way to list all operations in progress?
When I try to update the VPN Gateway because it's stuck in provisioning I get the following error:
Update-AzVpnGateway : Another operation on this or dependent resource is in progress. To retrieve status of the operation use uri:
https://management.azure.com/subscriptions/<SUBSCRIPTION ID>/providers/Microsoft.Network/locations/northeurope/operations/1c48d2e0-2605-40c4-8ee9-fa538cbe7ec9?api-version=2023-09-01.
StatusCode: 409
ReasonPhrase: Conflict
ErrorCode: AnotherOperationInProgress
ErrorMessage: Another operation on this or dependent resource is in progress. To retrieve status of the operation use uri:
https://management.azure.com/subscriptions/<SUBSCRIPTION ID>/providers/Microsoft.Network/locations/northeurope/operations/1c48d2e0-2605-40c4-8ee9-fa538cbe7ec9?api-version=2023-09-01.
OperationID : 08062ee9-035d-43e9-bb86-dc20c4095cc1
Is there a way to list all Operations in Progress, and kill them if necessary?
Azure Virtual WAN
Azure
-
Sina Salam 12,011 Reputation points
2024-06-17T13:53:20.8466667+00:00 Hello Admin Hinton-Smith,
Welcome to the Microsoft Q&A and thank you for posting your questions here.
I understand that you are having difficulties to list all Operations in Progress, and you would like to kill them if necessary.
Solution
In your Microsoft Azure, navigate to Azure CLI. The below script is a combining these steps using Azure CLI, notice the comment in the script to run it one after the other:
# Log in to Azure az login # Set Variables subscriptionId="<SUBSCRIPTION ID>" resourceGroupName="<ResourceGroupName>" vpnGatewayName="<VpnGatewayName>" operationUri="https://management.azure.com/subscriptions/$subscriptionId/providers/Microsoft.Network/locations/northeurope/operations/1c48d2e0-2605-40c4-8ee9-fa538cbe7ec9?api-version=2023-09-01" # Get Operation Status az rest --method get --uri "$operationUri" # Retry the Operation (if necessary) az network vpn-gateway update --resource-group $resourceGroupName --name $vpnGatewayName # If Retry Fails, Delete and Recreate the VPN Gateway (Last Resort) # az network vpn-gateway delete --resource-group $resourceGroupName --name $vpnGatewayName # az network vpn-gateway create --resource-group $resourceGroupName --name $vpnGatewayName --location "<Location>" --vnet "<VNetName>" --public-ip-address "<PublicIpAddressName>"
Unfortunately, Azure CLI doesn't provide a direct command to list all operations in progress for all resources.
You can use Azure PowerShell as showing below, ensure you run each command one after the other, also notice the comment for each tasks to perform:
#Install the Az module (if you haven’t already) Install-Module -Name Az -AllowClobber -Force #Connect to your Azure account Connect-AzAccount #Get the status of the specific operation: $operationUri = "https://management.azure.com/subscriptions/<SUBSCRIPTION ID>/providers/Microsoft.Network/locations/northeurope/operations/1c48d2e0-2605-40c4-8ee9-fa538cbe7ec9?api-version=2023-09-01" Invoke-RestMethod -Uri $operationUri -Method Get #List All Operations (if you need to check more than one) Get-AzResourceGroup -ResourceGroupName "<ResourceGroupName>" | Get-AzResource #Retry the Operation Update-AzVpnGateway -ResourceGroupName "<ResourceGroupName>" -Name "<VpnGatewayName>" #Delete the resource: Remove-AzVpnGateway -ResourceGroupName "<ResourceGroupName>" -Name "<VpnGatewayName>" #Recreate the resource: New-AzVpnGateway -ResourceGroupName "<ResourceGroupName>" -Name "<VpnGatewayName>" -Location "<Location>"
Accept Answer
I hope this is helpful! Do not hesitate to let me know if you have any other questions.
** Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful ** so that others in the community facing similar issues can easily find the solution.
Best Regards,
Sina Salam
-
KapilAnanth-MSFT 46,776 Reputation points • Microsoft Employee
2024-06-18T10:58:55.09+00:00 Welcome to the Microsoft Q&A Platform. Thank you for reaching out & I hope you are doing well.
- Is the VPN Gateway resource still in a Updating/Failed Provisioning state?
- You can check it from the Portal
- or from Powershell using Get-AzVirtualNetworkGateway
- If it is in Updating state, that means there is an operation running on the resource.
Cheers,
Kapil
-
Admin Hinton-Smith 0 Reputation points
2024-06-19T08:13:15.27+00:00 Hi Kapil,
I can't delete and recreate the VWAN Hub VPN gateway as there are 155 sites connected to it and recreating it would cut all of them off.
I've tried checking on that operation today and it says it's no longer found but I the gateway is still in Updating.
I tried the step to list all operations but it doesn't like the resource identifier
Get-AzResourceGroup -ResourceGroupName "global-vwan-connectivity" | Get-AzResource
Get-AzResource : Invalid format of the resource identifier.
Parameter name: idFromServer
At line:1 char:69
- ... eGroup -ResourceGroupName "<RESOURCE GROUP>" | Get-AzResource
-
~~~~~~~~~~~~~~
- CategoryInfo : CloseError: (:) [Get-AzResource], ArgumentException
- FullyQualifiedErrorId : Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.GetAzureResourceCmdlet
I tried Get-AzResource on it's own but it just gives me a list of the resources in the resource group, it doesn't tell me anything about ongoing operations and their status.
It's been stuck in Updating now for three days when it says it should only take 30 minutes.
I can do a GET & PUT from resources.azure.com on Friday night to try and resolve the problem but I'm hesitant to do that whilst there's a potentials ongoing operation as I might just be queueing up more operations that need to complete.
-
Admin Hinton-Smith 0 Reputation points
2024-06-19T08:17:57.36+00:00 Hi Kapil,
It's still stuck in updating.
I can't recreate the VPN Gateway as it's a VWAN Hub VPN Gateway and serves 155 VPNs which are all live with active user data.
I tried looking at that operation today but it says that it doesn't exist so I can only assume it finished.
I tried to see a list of all ongoing operations with the powershell script but it fails
Get-AzResourceGroup -ResourceGroupName "global-vwan-connectivity" | Get-AzResource
Get-AzResource : Invalid format of the resource identifier.
Parameter name: idFromServer
At line:1 char:69
- ... eGroup -ResourceGroupName "global-vwan-connectivity" | Get-AzResource
-
~~~~~~~~~~~~~~
- CategoryInfo : CloseError: (:) [Get-AzResource], ArgumentException
- FullyQualifiedErrorId : Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.GetAzureResourceCmdlet
I tried Get-AzResource on it's own and it just gives me a list of the resources in the resource group not a list of ongoing operations and their status.
I can do a GET & PUT on the VPN Gateways config at the weekend with resources.azure.com but I'm worried about doing that whilst there are still ongoing operations, I don't want to queue up more things and leave it in an Updating state longer.
-
KapilAnanth-MSFT 46,776 Reputation points • Microsoft Employee
2024-06-19T08:22:00.8733333+00:00 Wrt, "It's still stuck in updating."
- Do you see it from Azure Portal?
- If so, can you share a screenshot?
- Can you give me an approximate time as how long this has been in this state?
Cheers,
Kapil
-
Admin Hinton-Smith 0 Reputation points
2024-06-19T09:14:04.82+00:00 Hi Kapil,
I've attached two screenshots from the VWAN Hub.
It's been like this for about three days now
-
Admin Hinton-Smith 0 Reputation points
2024-06-19T09:16:52.9833333+00:00 I'm not sure it likes my attachments so I've tried uploading them again as JPEGs.
-
Admin Hinton-Smith 0 Reputation points
2024-06-19T09:20:12.3966667+00:00 Screenshot 2024-06-19 101541.jpg
Screenshot 2024-06-19 101431.jpg
It doesn't like them as pictures, hopefully they'll upload as files
-
KapilAnanth-MSFT 46,776 Reputation points • Microsoft Employee
2024-06-19T16:54:29.0466667+00:00 I am still not able to see the images, however, that should be fine.
To troubleshoot any CRUD related issues, we will need a specialized 1:1 session, where a support engineer can have a screen share session to pinpoint the issue.
If you have a support plan you may file a support ticket, else please do let us know, we will try and help you get a one-time free technical support.
P.S : We will be able to provide a free support if and only if you do not have a CSP subscription
Cheers,
Kapil
Sign in to comment