Skip to content

Commit 75436cf

Browse files
authored
Merge pull request #194543 from stegag/patch-25
new article about 'Troubleshoot Microsoft.Network Failed Provisioning State'
2 parents 3c6c8fc + c266202 commit 75436cf

File tree

2 files changed

+268
-1
lines changed

2 files changed

+268
-1
lines changed

articles/networking/TOC.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,4 +164,8 @@
164164
- name: Stack Overflow
165165
href: https://stackoverflow.com/questions/tagged/azure-virtual-network
166166
- name: Videos
167-
href: https://azure.microsoft.com/resources/videos/index/?services=virtual-network
167+
href: https://azure.microsoft.com/resources/videos/index/?services=virtual-network
168+
- name: Troubleshooting
169+
items:
170+
- name: Troubleshoot Microsoft.Network Failed provisioning state
171+
href: troubleshoot-failed-state.md
Lines changed: 263 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,263 @@
1+
---
2+
title: 'Troubleshoot Azure Microsoft.Network failed Provisioning State'
3+
description: Learn how to troubleshoot Azure Microsoft.Network failed Provisioning State.
4+
services: networking
5+
author: stegag
6+
7+
ms.service: virtual-network
8+
ms.topic: how-to
9+
ms.date: 04/08/2022
10+
ms.author: stegag
11+
12+
---
13+
14+
# Troubleshoot Azure Microsoft.Network failed provisioning state
15+
16+
This article helps understand the meaning of various provisioning states for Microsoft.Network resources and how to effectively troubleshoot situations when the state is **Failed**.
17+
18+
[!INCLUDE [support-disclaimer](../../includes/support-disclaimer.md)]
19+
20+
## Provisioning states
21+
22+
The provisioning state is the status of a user-initiated, control-plane operation on an Azure Resource Manager resource.
23+
24+
| Provisioning state | Description |
25+
|---|---|
26+
| Updating | Resource is being created or updated. |
27+
| Failed | Last operation on the resource was not successful. |
28+
| Succeeded | Last operation on the resource was successful. |
29+
| Deleting | Resource is being deleted. |
30+
| Migrating | Seen when migrating from Azure Service Manager to Azure Resource Manager. |
31+
32+
These states are just metadata properties of the resource and are independent from the functionality of the resource itself.
33+
Being in a failed state does not necessarily mean that the resource is not functional, in fact in most cases it can continue operating and servicing traffic without issues.
34+
35+
However in several scenarios further operations on the resource or on other resources that depend on it may fail if the resource is in failed state, so the state needs to be reverted back to succeeded before executing other operations.
36+
37+
For example, you cannot execute an operation on a VirtualNetworkGateway if it has a dependent VirtualNetworkGatewayConnection object in failed state and viceversa.
38+
39+
## Restoring succeeded state through a PUT operation
40+
41+
The correct way to restore succeeded state is to execute another write (PUT) operation on the resource.
42+
43+
Most times, the issue that caused the previous operation might no longer be current, hence the newer write operation should be successful and restore the provisioning state.
44+
45+
The easiest way to achieve this task is to use Azure PowerShell. You will need to issue a resource-specific "Get" command that fetches all the current configuration for the impacted resource as it is deployed. Next, you can execute a "Set" command (or equivalent) to commit to Azure a write operation containing all the resource properties as they are currently configured.
46+
47+
> [!IMPORTANT]
48+
> 1. Executing a "Set" command on the resource without running a "Get" first will result in overwriting the resource with default settings which might be different from those you currently have configured. Do not just run a "Set" command unless resetting settings is intentional.
49+
> 2. Executing a "Get" and "Set" operation using third party software or otherwise any tool using older API version may also result in loss of some settings, as those may not be present in the API version with which you have executed the command.
50+
>
51+
## Azure PowerShell cmdlets to restore succeeded provisioning state
52+
53+
[!INCLUDE [updated-for-az](../../includes/hybrid-az-ps.md)]
54+
55+
### Preliminary operations
56+
57+
1. Install the latest version of the Azure Resource Manager PowerShell cmdlets. For more information, see [Install and configure Azure PowerShell](/powershell/azure/install-az-ps).
58+
59+
2. Open your PowerShell console with elevated privileges, and connect to your account. Use the following example to help you connect:
60+
61+
```azurepowershell-interactive
62+
Connect-AzAccount
63+
```
64+
3. If you have multiple Azure subscriptions, check the subscriptions for the account.
65+
66+
```azurepowershell-interactive
67+
Get-AzSubscription
68+
```
69+
4. Specify the subscription that you want to use.
70+
71+
```azurepowershell-interactive
72+
Select-AzSubscription -SubscriptionName "Replace_with_your_subscription_name"
73+
```
74+
5. Run the resource-specific commands listed below to reset the provisioning state to succeeded.
75+
76+
> [!NOTE]
77+
>Every sample command in this article uses "your_resource_name" for the name of the Resource and "your_resource_group_name" for the name of the Resource Group. Make sure to replace these strings with the appropriate Resource and Resource Group names according to your deployment.
78+
79+
### Microsoft.Network/applicationGateways
80+
81+
```azurepowershell-interactive
82+
Get-AzApplicationGateway -Name "your_resource_name" -ResourceGroupName "your_resource_group_name" | Set-AzApplicationGateway
83+
```
84+
85+
### Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies
86+
87+
```azurepowershell-interactive
88+
Get-AzApplicationGatewayFirewallPolicy -Name "your_resource_name" -ResourceGroupName "your_resource_group_name" | Set-AzApplicationGatewayFirewallPolicy
89+
```
90+
### Microsoft.Network/azureFirewalls
91+
92+
```azurepowershell-interactive
93+
Get-AzFirewall -Name "your_resource_name" -ResourceGroupName "your_resource_group_name" | Set-AzFirewall
94+
```
95+
### Microsoft.Network/bastionHosts
96+
97+
```azurepowershell-interactive
98+
$bastion = Get-AzBastion -Name "your_resource_name" -ResourceGroupName "your_resource_group_name"
99+
Set-AzBastion -InputObject $bastion
100+
```
101+
102+
### Microsoft.Network/connections
103+
104+
```azurepowershell-interactive
105+
Get-AzVirtualNetworkGatewayConnection -Name "your_resource_name" -ResourceGroupName "your_resource_group_name" | Set-AzVirtualNetworkGatewayConnection
106+
107+
```
108+
109+
### Microsoft.Network/expressRouteCircuits
110+
111+
```azurepowershell-interactive
112+
Get-AzExpressRouteCircuit -Name "your_resource_name" -ResourceGroupName "your_resource_group_name" | Set-AzExpressRouteCircuit
113+
```
114+
115+
### Microsoft.Network/expressRouteGateways
116+
117+
```azurepowershell-interactive
118+
Get-AzExpressRouteGateway -Name "your_resource_name" -ResourceGroupName "your_resource_group_name" | Set-AzExpressRouteGateway
119+
```
120+
121+
> [!NOTE]
122+
> **Microsoft.Network/expressRouteGateways** are those gateways deployed within a Virtual WAN. If you have a standalone gateway of ExpressRoute type in your Virtual Network you need to execute the commands related to [Microsoft.Network/virtualNetworkGateways](#microsoftnetworkvirtualnetworkgateways).
123+
124+
### Microsoft.Network/expressRoutePorts
125+
126+
```azurepowershell-interactive
127+
Get-AzExpressRoutePort -Name "your_resource_name" -ResourceGroupName "your_resource_group_name" | Set-AzExpressRoutePort
128+
```
129+
130+
### Microsoft.Network/firewallPolicies
131+
132+
```azurepowershell-interactive
133+
Get-AzFirewallPolicy -Name "your_resource_name" -ResourceGroupName "your_resource_group_name" | Set-AzFirewallPolicy
134+
```
135+
136+
### Microsoft.Network/loadBalancers
137+
138+
```azurepowershell-interactive
139+
Get-AzLoadBalancer -Name "your_resource_name" -ResourceGroupName "your_resource_group_name" | Set-AzLoadBalancer
140+
```
141+
142+
### Microsoft.Network/localNetworkGateways
143+
144+
```azurepowershell-interactive
145+
Get-AzLocalNetworkGateway -Name "your_resource_name" -ResourceGroupName "your_resource_group_name" | Set-AzLocalNetworkGateway
146+
```
147+
148+
### Microsoft.Network/natGateways
149+
150+
```azurepowershell-interactive
151+
Get-AzNatGateway -Name "your_resource_name" -ResourceGroupName "your_resource_group_name" | Set-AzNatGateway
152+
```
153+
154+
### Microsoft.Network/networkInterfaces
155+
156+
```azurepowershell-interactive
157+
Get-AzNetworkInterface -Name "your_resource_name" -ResourceGroupName "your_resource_group_name" | Set-AzNetworkInterface
158+
```
159+
160+
### Microsoft.Network/networkSecurityGroups
161+
162+
```azurepowershell-interactive
163+
Get-AzNetworkSecurityGroup -Name "your_resource_name" -ResourceGroupName "your_resource_group_name" | Set-AzNetworkSecurityGroup
164+
```
165+
166+
### Microsoft.Network/networkVirtualAppliances
167+
168+
```azurepowershell-interactive
169+
Get-AzNetworkVirtualAppliance -Name "your_resource_name" -ResourceGroupName "your_resource_group_name" | Update-AzNetworkVirtualAppliance
170+
```
171+
> [!NOTE]
172+
> Most Virtual WAN related resources such as networkVirtualAppliances leverage the "Update" cmdlet and not the "Set" for write operations.
173+
>
174+
### Microsoft.Network/privateDnsZones
175+
176+
```azurepowershell-interactive
177+
Get-AzPrivateDnsZone -Name "your_resource_name" -ResourceGroupName "your_resource_group_name" | Set-AzPrivateDnsZone
178+
```
179+
180+
### Microsoft.Network/privateEndpoints
181+
182+
```azurepowershell-interactive
183+
Get-AzPrivateEndpoint -Name "your_resource_name" -ResourceGroupName "your_resource_group_name" | Set-AzPrivateEndpoint
184+
```
185+
186+
### Microsoft.Network/privateLinkServices
187+
188+
```azurepowershell-interactive
189+
Get-AzPrivateLinkService -Name "your_resource_name" -ResourceGroupName "your_resource_group_name" | Set-AzPrivateLinkService
190+
```
191+
192+
### Microsoft.Network/publicIpAddresses
193+
194+
```azurepowershell-interactive
195+
Get-AzPublicIpAddress -Name "your_resource_name" -ResourceGroupName "your_resource_group_name" | Set-AzPublicIpAddress
196+
```
197+
198+
### Microsoft.Network/routeFilters
199+
200+
```azurepowershell-interactive
201+
Get-AzRouteFilter -Name "your_resource_name" -ResourceGroupName "your_resource_group_name" | Set-AzRouteFilter
202+
```
203+
204+
### Microsoft.Network/routeTables
205+
206+
```azurepowershell-interactive
207+
Get-AzRouteTable -Name "your_resource_name" -ResourceGroupName "your_resource_group_name" | Set-AzRouteTable
208+
```
209+
210+
### Microsoft.Network/virtualHubs
211+
212+
```azurepowershell-interactive
213+
Get-AzVirtualHub -Name "your_resource_name" -ResourceGroupName "your_resource_group_name" | Update-AzVirtualHub
214+
```
215+
> [!NOTE]
216+
> Most Virtual WAN related resources such as virtualHubs leverage the "Update" cmdlet and not the "Set" for write operations.
217+
>
218+
### Microsoft.Network/virtualNetworkGateways
219+
220+
```azurepowershell-interactive
221+
Get-AzVirtualNetworkGateway -Name "your_resource_name" -ResourceGroupName "your_resource_group_name" | Set-AzVirtualNetworkGateway
222+
```
223+
224+
### Microsoft.Network/virtualNetworks
225+
226+
```azurepowershell-interactive
227+
Get-AzVirtualNetwork -Name "your_resource_name" -ResourceGroupName "your_resource_group_name" | Set-AzVirtualNetwork
228+
```
229+
230+
### Microsoft.Network/virtualWans
231+
232+
```azurepowershell-interactive
233+
Get-AzVirtualWan -Name "your_resource_name" -ResourceGroupName "your_resource_group_name" | Update-AzVirtualWan
234+
```
235+
> [!NOTE]
236+
> Most Virtual WAN related resources such as virtualWans leverage the "Update" cmdlet and not the "Set" for write operations.
237+
238+
### Microsoft.Network/vpnGateways
239+
240+
```azurepowershell-interactive
241+
Get-AzVpnGateway -Name "your_resource_name" -ResourceGroupName "your_resource_group_name" | Update-AzVpnGateway
242+
```
243+
> [!NOTE]
244+
> 1. **Microsoft.Network/vpnGateways** are those gateways deployed within a Virtual WAN. If you have a standalone gateway of VPN type in your Virtual Network you need to execute the commands related to [Microsoft.Network/virtualNetworkGateways](#microsoftnetworkvirtualnetworkgateways).
245+
> 2. Most Virtual WAN related resources such as vpnGateways leverage the "Update" cmdlet and not the "Set" for write operations.
246+
247+
### Microsoft.Network/vpnSites
248+
249+
```azurepowershell-interactive
250+
Get-AzVpnSite -Name "your_resource_name" -ResourceGroupName "your_resource_group_name" | Update-AzVpnSite
251+
```
252+
> [!NOTE]
253+
> Most Virtual WAN related resources such as vpnSites leverage the "Update" cmdlet and not the "Set" for write operations.
254+
255+
256+
257+
## Next steps
258+
259+
If the command executed didn't fix the failed state, it should return an error code for you.
260+
Most error codes contain a detailed description of what the problem might be and offer hints to solve it.
261+
262+
Open a support ticket with [Microsoft support](https://portal.azure.com/?#blade/Microsoft_Azure_Support/HelpAndSupportBlade) if you're still experiencing issues.
263+
Make sure you specify to the Support Agent both the error code you received in the latest operation, as well as the timestamp of when the operation was executed.

0 commit comments

Comments
 (0)