azure-powershell icon indicating copy to clipboard operation
azure-powershell copied to clipboard

Az.ServiceBus:1.8.0; Remove-AzServiceBusNamespace not deleting namespace

Open apoorva-kamath-maersk opened this issue 3 years ago • 4 comments

Description

When I run Remove-AzServiceBusNamespace command it does not delete the namespace but I get a successfully deleted message without any error. Refer below the complete command and the debug logs for your reference.

Issue script & Debug output

PS C:\Work\Repositories\scm-central-pipeline-templates\scripts\ServiceBusDR>> Remove-AzServiceBusNamespace -ResourceGroupName "xxxxxxxxxxxxxxx" -Name "xxxxxxxxxxxxxxxxxxxxx" -Debug
DEBUG: 20:13:24 - RemoveAzureRmServiceBusNamespace begin processing with ParameterSet 'NamespacePropertiesSet'.

Confirm
Continue with this operation?
[Y] Yes  [A] Yes to All  [H] Halt Command  [S] Suspend  [?] Help (default is "Y"): A
DEBUG: 20:13:27 - using account id 'xxxxxxxxxxxxxxxxxxxxxxx'...

Confirm
Are you sure you want to perform this action?
Performing the operation "Delete Namespace:XXXXXXXXXXXXXXXXXXXX ofthe ResourceGroup:XXXXXXXXXXXXXX" on target "XXXXXXXXXXXXXXXXXXXXXX".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): Y
DEBUG: [Common.Authentication]: Authenticating using Account: 'XXXXXXXXXXXXXXXXXXXXXXXX', environment: 'AzureCloud', tenant: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
DEBUG: 20:13:31 - [SilentAuthenticator] Calling SharedTokenCacheCredential.GetTokenAsync - TenantId:'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX', 
Scopes:'https://management.core.windows.net//.default', AuthorityHost:'https://login.microsoftonline.com/', UserId:'XXXXXXXXXXXXXXXXXXXXXXXXX'
DEBUG: SharedTokenCacheCredential.GetToken invoked. Scopes: [ https://management.core.windows.net//.default ] ParentRequestId: 
DEBUG: (False) MSAL 4.30.1.0 MSAL.Desktop Windows 10 Enterprise [07/28/2022 14:43:31 - ] Azure region was not configured or could not be discovered. Not using a regional      
authority.
DEBUG: (False) MSAL 4.30.1.0 MSAL.Desktop Windows 10 Enterprise [07/28/2022 14:43:31] Found 2 cache accounts and 0 broker accounts
DEBUG: (False) MSAL 4.30.1.0 MSAL.Desktop Windows 10 Enterprise [07/28/2022 14:43:31] Returning 2 accounts
DEBUG: (False) MSAL 4.30.1.0 MSAL.Desktop Windows 10 Enterprise [07/28/2022 14:43:31 - ] MSAL MSAL.Desktop with assembly version '4.30.1.0'. 
CorrelationId(XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX)
DEBUG: (False) MSAL 4.30.1.0 MSAL.Desktop Windows 10 Enterprise [07/28/2022 14:43:31 - ] === AcquireTokenSilent Parameters ===
DEBUG: (False) MSAL 4.30.1.0 MSAL.Desktop Windows 10 Enterprise [07/28/2022 14:43:31 - ] LoginHint provided: False
DEBUG: (False) MSAL 4.30.1.0 MSAL.Desktop Windows 10 Enterprise [07/28/2022 14:43:31 - ] Account provided: True
DEBUG: (False) MSAL 4.30.1.0 MSAL.Desktop Windows 10 Enterprise [07/28/2022 14:43:31 - ] ForceRefresh: False
DEBUG: (False) MSAL 4.30.1.0 MSAL.Desktop Windows 10 Enterprise [07/28/2022 14:43:31 - ] 
=== Request Data ===
Authority Provided? - True
Scopes - https://management.core.windows.net//.default
Extra Query Params Keys (space separated) -
ApiId - AcquireTokenSilent
IsConfidentialClient - False
SendX5C - False
LoginHint ? False
IsBrokerConfigured - False
HomeAccountId - False
CorrelationId - XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
DEBUG: (False) MSAL 4.30.1.0 MSAL.Desktop Windows 10 Enterprise [07/28/2022 14:43:31 - ] === Token Acquisition (SilentRequest) started:

 Authority Host: login.microsoftonline.com
DEBUG: (False) MSAL 4.30.1.0 MSAL.Desktop Windows 10 Enterprise [07/28/2022 14:43:31 - ] Azure region was not configured or could not be discovered. Not using a regional      
authority.
DEBUG: (False) MSAL 4.30.1.0 MSAL.Desktop Windows 10 Enterprise [07/28/2022 14:43:31 - ] Access token is not expired. Returning the found cache entry. [Current time 
(07/28/2022 14:43:31) - Expiration Time (07/28/2022 15:34:57 +00:00) - Extended Expiration Time (07/28/2022 15:34:57 +00:00)]
DEBUG: (False) MSAL 4.30.1.0 MSAL.Desktop Windows 10 Enterprise [07/28/2022 14:43:31 - ] Returning access token found in cache. RefreshOn exists ? False
DEBUG: (False) MSAL 4.30.1.0 MSAL.Desktop Windows 10 Enterprise [07/28/2022 14:43:31 - ] Fetched access token from host login.microsoftonline.com. 
DEBUG: (False) MSAL 4.30.1.0 MSAL.Desktop Windows 10 Enterprise [07/28/2022 14:43:31 - ] === Token Acquisition finished successfully. An access token was returned with        
Expiration Time: 07/28/2022 15:34:57 +00:00 and Scopes https://management.core.windows.net//user_impersonation https://management.core.windows.net//.default
DEBUG: SharedTokenCacheCredential.GetToken succeeded. Scopes: [ https://management.core.windows.net//.default ] ParentRequestId:  ExpiresOn: 2022-07-28T15:34:57.0000000+00:00 
DEBUG: [Common.Authentication]: Received token with LoginType 'User', Tenant: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', UserId: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
DELETE

Absolute Uri:
https://management.azure.com/subscriptions/XXXXXXXXXXXXXXXXXXXXXXX/resourceGroups/XXXXXXXXXXXXXXXXXXXX/providers/Microsoft.ServiceBus/namespaces/XXXXXXXXXXXXXXX?api-version=2021-06-01-preview

Headers:
x-ms-client-request-id        : e19bc1ec-07ff-4e94-a109-3a416024784e
accept-language               : en-US

Body:


DEBUG: AzureQoSEvent: Module: Az.ServiceBus:1.8.0; CommandName: Remove-AzServiceBusNamespace; PSVersion: 5.1.19041.1682; IsSuccess: True; Duration: 00:00:06.5973404
DEBUG: Finish sending metric.
DEBUG: 20:13:32 - RemoveAzureRmServiceBusNamespace end processing.

Environment data

PS C:\Work\Repositories\scm-central-pipeline-templates\scripts\ServiceBusDR>> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.19041.1682
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.19041.1682
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1


PS C:\Work\Repositories\scm-central-pipeline-templates\scripts\ServiceBusDR>>

Module versions

PS C:\Work\Repositories\scm-central-pipeline-templates\scripts\ServiceBusDR>> Get-Module AZ*

ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script     2.7.3      Az.Accounts                         {Add-AzEnvironment, Clear-AzContext, Clear-AzDefault, Connect-AzAccount...}
Script     5.4.0      Az.Resources                        {Export-AzResourceGroup, Export-AzTemplateSpec, Get-AzDenyAssignment, Get-AzDeployment...}
Script     1.8.0      Az.ServiceBus                       {Add-AzServiceBusIPRule, Add-AzServiceBusVirtualNetworkRule, Complete-AzServiceBusMigration, Get-AzServiceBusAuth...


PS C:\Work\Repositories\scm-central-pipeline-templates\scripts\ServiceBusDR>>

Error output

No Error command runs successfully

apoorva-kamath-maersk avatar Jul 28 '22 14:07 apoorva-kamath-maersk

Thank you for your feedback. This has been routed to the support team for assistance.

msftbot[bot] avatar Jul 29 '22 13:07 msftbot[bot]

@apoorva-kamath-maersk We are looking into it and get back to you for any additional information.

SaurabhSharma-MSFT avatar Jul 31 '22 17:07 SaurabhSharma-MSFT

@apoorva-kamath-maersk I do not see any issues with the cmdlet and it removes the Service Bus namespace without any issues.

SaurabhSharma-MSFT avatar Aug 01 '22 23:08 SaurabhSharma-MSFT

@apoorva-kamath-maersk Please let me know if you any questions else we will proceed with the closure of this issue.

SaurabhSharma-MSFT avatar Aug 05 '22 21:08 SaurabhSharma-MSFT

Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!

msftbot[bot] avatar Aug 13 '22 02:08 msftbot[bot]