Azure / azure-powershell

Microsoft Azure PowerShell
Other
4.26k stars 3.86k forks source link

Set-AzDiagnosticSetting gives a storage not provisioned error #12165

Closed Panzerbjrn closed 4 years ago

Panzerbjrn commented 4 years ago

Description

I'm trying to set up some diagnostic logging for a Power BI Embedded capacity via this PowerShell command, but it isn't working.

The command I'm running is: `Set-AzDiagnosticSetting -ResourceId "/subscriptions/1fa2b345-67c2-890d-1ef2-aded8b8bc224/resourceGroups/LPTestRG/providers/Microsoft.PowerBIDedicated/capacities/pbiewi38848" -StorageAccountId "/subscriptions/1fa2b345-67c2-890d-1ef2-aded8b8bc224/resourceGroups/LPTestRG/providers/Microsoft.Storage/storageAccounts/lptestsa"

I then get the error:

'/subscriptions/1fa2b345-67c2-890d-1ef2-aded8b8bc224/resourcegroups/lptestrg/providers/microsoft.storage/storageaccounts/lptestsa' is not accessible yet. Try again when storage provisioning is complete.,
Code: Conflict, Status code:Conflict, Reason phrase: Conflict```

Running `Get-AzStorageAccount` and looking in the portal, I can see that provisioning has succeeded, and I have a bunch of blobs and tables in there anyway, so I know that it works.
I am running the latest AZ module, and have checked Az.Monitor and Az.Storage against the PS Gallery to be sure.

## Steps to reproduce

```powershell
Set-AzDiagnosticSetting -ResourceId "/subscriptions/1fa2b345-67c2-890d-1ef2-aded8b8bc224/resourceGroups/LPTestRG/providers/Microsoft.PowerBIDedicated/capacities/pbiewi38848" -StorageAccountId "/subscriptions/1fa2b345-67c2-890d-1ef2-aded8b8bc224/resourceGroups/LPTestRG/providers/Microsoft.Storage/storageAccounts/lptestsa"

Environment data

$PSVersionTable                                                                                                                                                                                      
Name                           Value
----                           -----
PSVersion                      5.1.18362.752
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.18362.752
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Module versions


Name                                      Version         ModuleType
----                                      -------         ----------
AWSPowerShell                             4.0.5.0             Binary
AWSPowerShell                             3.3.563.1           Binary
AxCosmosDB                                1.0.0               Script
Az.Accounts                               1.8.1               Script
Az.Accounts                               1.7.4               Script
Az.Accounts                               1.7.3               Script
Az.Accounts                               1.6.3               Script
Az.Accounts                               1.6.2               Script
Az.Advisor                                1.1.1               Script
Az.Advisor                                1.0.1               Script
Az.Aks                                    1.1.1               Script
Az.Aks                                    1.0.3               Script
Az.Aks                                    1.0.2               Script
Az.AnalysisServices                       1.1.3               Script
Az.AnalysisServices                       1.1.2               Script
Az.AnalysisServices                       1.1.1               Script
Az.ApiManagement                          2.0.1               Script
Az.ApiManagement                          1.4.0               Script
Az.ApiManagement                          1.3.2               Script
Az.ApiManagement                          1.3.0               Script
Az.ApplicationInsights                    1.1.0               Script
Az.ApplicationInsights                    1.0.3               Script
Az.ApplicationInsights                    1.0.2               Script
Az.Automation                             1.3.6               Script
Az.Automation                             1.3.4               Script
Az.Automation                             1.3.2               Script
Az.Batch                                  3.0.0               Script
Az.Batch                                  2.0.2               Script
Az.Batch                                  1.1.2               Script
Az.Batch                                  1.1.1               Script
Az.Billing                                1.0.3               Script
Az.Billing                                1.0.2               Script
Az.Billing                                1.0.1               Script
Az.Cdn                                    1.4.3               Script
Az.Cdn                                    1.4.2               Script
Az.Cdn                                    1.3.1               Script
Az.CognitiveServices                      1.4.0               Script
Az.CognitiveServices                      1.2.3               Script
Az.CognitiveServices                      1.2.1               Script
Az.Compute                                4.1.0               Script
Az.Compute                                3.6.0               Script
Az.Compute                                3.5.0               Script
Az.Compute                                2.7.0               Script
Az.Compute                                2.5.0               Script
Az.ContainerInstance                      1.0.3               Script
Az.ContainerInstance                      1.0.1               Script
Az.ContainerRegistry                      1.1.1               Script
Az.ContainerRegistry                      1.1.0               Script
Az.CosmosDB                               0.1.3               Script
Az.CosmosDB                               0.1.2               Script
Az.DataBoxEdge                            1.1.0               Script
Az.DataFactory                            1.8.1               Script
Az.DataFactory                            1.7.0               Script
Az.DataFactory                            1.6.1               Script
Az.DataFactory                            1.4.0               Script
Az.DataFactory                            1.2.0               Script
Az.DataLakeAnalytics                      1.0.2               Script
Az.DataLakeAnalytics                      1.0.1               Script
Az.DataLakeStore                          1.2.8               Script
Az.DataLakeStore                          1.2.7               Script
Az.DataLakeStore                          1.2.3               Script
Az.DataLakeStore                          1.2.2               Script
Az.DataShare                              1.0.0               Script
Az.DeploymentManager                      1.1.0               Script
Az.DeploymentManager                      1.0.1               Script
Az.DesktopVirtualization                  1.0.0               Script
Az.DevTestLabs                            1.0.2               Script
Az.DevTestLabs                            1.0.0               Script
Az.Dns                                    1.1.2               Script
Az.Dns                                    1.1.1               Script
Az.EventGrid                              1.2.3               Script
Az.EventGrid                              1.2.2               Script
Az.EventHub                               1.4.3               Script
Az.EventHub                               1.4.0               Script
Az.FrontDoor                              1.5.0               Script
Az.FrontDoor                              1.4.0               Script
Az.FrontDoor                              1.1.1               Script
Az.Functions                              1.0.0               Script
Az.HDInsight                              3.2.0               Script
Az.HDInsight                              3.1.0               Script
Az.HDInsight                              3.0.3               Script
Az.HDInsight                              2.0.2               Script
Az.HDInsight                              2.0.1               Script
Az.HealthcareApis                         1.0.2               Script
Az.HealthcareApis                         1.0.1               Script
Az.HealthcareApis                         1.0.0               Script
Az.IotHub                                 2.5.0               Script
Az.IotHub                                 2.3.0               Script
Az.IotHub                                 2.2.0               Script
Az.IotHub                                 1.3.1               Script
Az.IotHub                                 1.2.1               Script
Az.KeyVault                               2.0.0               Script
Az.KeyVault                               1.5.2               Script
Az.KeyVault                               1.5.1               Script
Az.KeyVault                               1.3.1               Script
Az.LogicApp                               1.3.2               Script
Az.LogicApp                               1.3.1               Script
Az.MachineLearning                        1.1.3               Script
Az.MachineLearning                        1.1.1               Script
Az.Maintenance                            1.0.0               Script
Az.ManagedServices                        1.0.2               Script
Az.ManagedServices                        1.0.1               Script
Az.MarketplaceOrdering                    1.0.2               Script
Az.MarketplaceOrdering                    1.0.1               Script
Az.Media                                  1.1.1               Script
Az.Media                                  1.1.0               Script
Az.Monitor                                2.0.0               Script
Az.Monitor                                1.6.2               Script
Az.Monitor                                1.6.1               Script
Az.Monitor                                1.4.0               Script
Az.Monitor                                1.2.2               Script
Az.Network                                3.0.0               Script
Az.Network                                2.4.0               Script
Az.Network                                2.3.2               Script
Az.Network                                1.15.0              Script
Az.Network                                1.13.0              Script
Az.NotificationHubs                       1.1.1               Script
Az.NotificationHubs                       1.1.0               Script
Az.OperationalInsights                    2.1.0               Script
Az.OperationalInsights                    1.3.4               Script
Az.OperationalInsights                    1.3.3               Script
Az.PolicyInsights                         1.3.1               Script
Az.PolicyInsights                         1.2.1               Script
Az.PolicyInsights                         1.2.0               Script
Az.PolicyInsights                         1.1.3               Script
Az.PowerBIEmbedded                        1.1.2               Script
Az.PowerBIEmbedded                        1.1.1               Script
Az.PowerBIEmbedded                        1.1.0               Script
Az.PrivateDns                             1.0.3               Script
Az.PrivateDns                             1.0.2               Script
Az.RecoveryServices                       2.9.1               Script
Az.RecoveryServices                       2.8.0               Script
Az.RecoveryServices                       2.7.0               Script
Az.RecoveryServices                       1.4.5               Script
Az.RecoveryServices                       1.4.4               Script
Az.RedisCache                             1.2.1               Script
Az.RedisCache                             1.1.1               Script
Az.RedisCache                             1.1.0               Script
Az.Relay                                  1.0.3               Script
Az.Relay                                  1.0.2               Script
Az.Resources                              2.1.0               Script
Az.Resources                              1.13.0              Script
Az.Resources                              1.12.0              Script
Az.Resources                              1.9.1               Script
Az.Resources                              1.7.0               Script
Az.Resources                              1.6.2               Script
Az.ServiceBus                             1.4.1               Script
Az.ServiceBus                             1.4.0               Script
Az.ServiceFabric                          2.1.0               Script
Az.ServiceFabric                          2.0.1               Script
Az.ServiceFabric                          1.2.0               Script
Az.ServiceFabric                          1.1.2               Script
Az.SignalR                                1.1.1               Script
Az.SignalR                                1.1.0               Script
Az.SignalR                                1.0.3               Script
Az.Sql                                    2.7.0               Script
Az.Sql                                    2.5.0               Script
Az.Sql                                    2.4.0               Script
Az.Sql                                    1.15.0              Script
Az.Sql                                    1.14.1              Script
Az.SqlVirtualMachine                      1.1.0               Script
Az.Storage                                2.1.0               Script
Az.Storage                                1.13.0              Script
Az.Storage                                1.8.0               Script
Az.Storage                                1.6.0               Script
Az.StorageSync                            1.2.3               Script
Az.StorageSync                            1.2.1               Script
Az.StorageSync                            1.2.0               Script
Az.StreamAnalytics                        1.0.1               Script
Az.StreamAnalytics                        1.0.0               Script
Az.Support                                1.0.0               Script
Az.TrafficManager                         1.0.4               Script
Az.TrafficManager                         1.0.3               Script
Az.TrafficManager                         1.0.2               Script
Az.Websites                               1.9.0               Script
Az.Websites                               1.8.0               Script
Az.Websites                               1.7.0               Script
Az.Websites                               1.5.0               Script
Az.Websites                               1.4.1               Script
AzTable                                   2.0.2             Manifest
CosmosDB                                  3.7.0               Script
CosmosDB                                  3.6.1               Script
Microsoft.PowerShell.Operation.Validation 1.0.1               Script
MicrosoftPowerBIMgmt                      1.0.840           Manifest
MicrosoftPowerBIMgmt.Admin                1.0.840             Binary
MicrosoftPowerBIMgmt.Capacities           1.0.840             Binary
MicrosoftPowerBIMgmt.Data                 1.0.840             Binary
MicrosoftPowerBIMgmt.Profile              1.0.840             Binary
MicrosoftPowerBIMgmt.Reports              1.0.840             Binary
MicrosoftPowerBIMgmt.Workspaces           1.0.840             Binary
OnPremisesDataGatewayHAMgmt               3000.15.18          Script
PackageManagement                         1.0.0.1             Binary
Pester                                    4.10.1              Script
Pester                                    4.9.0               Script
Pester                                    3.4.0               Script
Plaster                                   1.1.3               Script
Posh-SSH                                  2.2               Manifest
PowerShellGet                             1.0.0.1             Script
PSReadline                                2.0.0               Script
PSScriptAnalyzer                          1.18.3              Script
SharePointPnPPowerShellOnline             3.21.2005.1         Binary
SharePointPnPPowerShellOnline             3.20.2004.0         Binary
SharePointPnPPowerShellOnline             3.19.2003.0         Binary
SharePointPnPPowerShellOnline             3.18.2002.0         Binary
SharePointPnPPowerShellOnline             3.17.2001.2         Binary
SharePointPnPPowerShellOnline             3.16.1912.0         Binary
VMware.DeployAutomation                   6.7.0.11233116      Script
VMware.ImageBuilder                       6.7.0.11233116      Script
VMware.PowerCLI                           11.4.0.14413515   Manifest
VMware.Vim                                6.7.0.13964812      Script
VMware.VimAutomation.Cis.Core             11.3.0.13964830     Script
VMware.VimAutomation.Cloud                11.0.0.10379994     Script
VMware.VimAutomation.Common               11.3.0.13964816     Script
VMware.VimAutomation.Core                 11.3.0.13964826     Script
VMware.VimAutomation.Hcx                  11.4.0.14413360     Script
VMware.VimAutomation.HorizonView          7.9.0.14170454      Script
VMware.VimAutomation.License              11.3.0.13990093     Script
VMware.VimAutomation.Nsxt                 11.3.0.13964817     Script
VMware.VimAutomation.Sdk                  11.3.0.13964823     Script
VMware.VimAutomation.Security             11.0.0.10380515     Script
VMware.VimAutomation.Srm                  11.2.0.12483605     Script
VMware.VimAutomation.Storage              11.4.0.14293163     Script
VMware.VimAutomation.StorageUtility       1.3.0.0             Script
VMware.VimAutomation.Vds                  11.2.0.12483615     Script
VMware.VimAutomation.Vmc                  11.3.0.13964814     Script
VMware.VimAutomation.vROps                10.0.0.7893921      Script
VMware.VumAutomation                      6.5.1.7862888       Script
WinSCP                                    5.17.2.0          Manifest
AppBackgroundTask                         1.0.0.0           Manifest
AppLocker                                 2.0.0.0           Manifest
AppvClient                                1.0.0.0           Manifest
Appx                                      2.0.1.0           Manifest
AssignedAccess                            1.0.0.0             Script
BitLocker                                 1.0.0.0           Manifest
BitsTransfer                              2.0.0.0           Manifest
BranchCache                               1.0.0.0           Manifest
CimCmdlets                                1.0.0.0           Manifest
ConfigCI                                  1.0               Manifest
ConfigDefender                            1.0               Manifest
Defender                                  1.0               Manifest
DeliveryOptimization                      1.0.2.0           Manifest
DirectAccessClientComponents              1.0.0.0           Manifest
Dism                                      3.0                 Script
DnsClient                                 1.0.0.0           Manifest
EventTracingManagement                    1.0.0.0           Manifest
International                             2.0.0.0           Manifest
iSCSI                                     1.0.0.0           Manifest
ISE                                       1.0.0.0             Script
Kds                                       1.0.0.0           Manifest
Microsoft.PowerShell.Archive              1.0.1.0           Manifest
Microsoft.PowerShell.Diagnostics          3.0.0.0           Manifest
Microsoft.PowerShell.Host                 3.0.0.0           Manifest
Microsoft.PowerShell.LocalAccounts        1.0.0.0           Manifest
Microsoft.PowerShell.Management           3.1.0.0           Manifest
Microsoft.PowerShell.ODataUtils           1.0                 Script
Microsoft.PowerShell.Security             3.0.0.0           Manifest
Microsoft.PowerShell.Utility              3.1.0.0           Manifest
Microsoft.WSMan.Management                3.0.0.0           Manifest
MMAgent                                   1.0               Manifest
MsDtc                                     1.0.0.0           Manifest
NetAdapter                                2.0.0.0           Manifest
NetConnection                             1.0.0.0           Manifest
NetEventPacketCapture                     1.0.0.0           Manifest
NetLbfo                                   2.0.0.0           Manifest
NetNat                                    1.0.0.0           Manifest
NetQos                                    2.0.0.0           Manifest
NetSecurity                               2.0.0.0           Manifest
NetSwitchTeam                             1.0.0.0           Manifest
NetTCPIP                                  1.0.0.0           Manifest
NetworkConnectivityStatus                 1.0.0.0           Manifest
NetworkSwitchManager                      1.0.0.0           Manifest
NetworkTransition                         1.0.0.0           Manifest
PcsvDevice                                1.0.0.0           Manifest
PersistentMemory                          1.0.0.0             Binary
PKI                                       1.0.0.0           Manifest
PnpDevice                                 1.0.0.0           Manifest
PrintManagement                           1.1               Manifest
ProcessMitigations                        1.0.11              Binary
Provisioning                              3.0                 Script
PSDesiredStateConfiguration               1.1               Manifest
PSDiagnostics                             1.0.0.0             Script
PSScheduledJob                            1.1.0.0             Binary
PSWorkflow                                2.0.0.0           Manifest
PSWorkflowUtility                         1.0.0.0           Manifest
ScheduledTasks                            1.0.0.0           Manifest
SecureBoot                                2.0.0.0           Manifest
SmbShare                                  2.0.0.0           Manifest
SmbWitness                                2.0.0.0           Manifest
StartLayout                               1.0.0.0           Manifest
Storage                                   2.0.0.0           Manifest
StorageBusCache                           1.0.0.0           Manifest
TLS                                       2.0.0.0           Manifest
TroubleshootingPack                       1.0.0.0           Manifest
TrustedPlatformModule                     2.0.0.0           Manifest
UEV                                       2.1.639.0           Binary
VpnClient                                 2.0.0.0           Manifest
Wdac                                      1.0.0.0           Manifest
Whea                                      2.0.0.0           Manifest
WindowsDeveloperLicense                   1.0.0.0           Manifest
WindowsErrorReporting                     1.0                 Script
WindowsSearch                             1.0.0.0           Manifest
WindowsUpdate                             1.0.0.0           Manifest
WindowsUpdateProvider                     1.0.0.2           Manifest

Debug output

DEBUG: 18:10:59 - SetAzureRmDiagnosticSettingCommand begin processing with ParameterSet 'OldSetDiagnosticSetting'.
DEBUG: 18:10:59 - using account id 'Admin_User@domain.net'...
WARNING: 18:10:59 - *** The namespace for all the model classes will change from Microsoft.Azure.Management.Monitor.Management.Models to Microsoft.Azure.Management.Monitor.Models in future releases.
WARNING: 18:10:59 - *** The namespace for output classes will be uniform for all classes in future releases to make it independent of modifications in the model classes.
DEBUG: 18:10:59 - Processing using command line arguments
DEBUG: 18:10:59 - Listing existing diagnostics settings for resourceId '/subscriptions/1fa2b345-67c2-890d-1ef2-aded8b8bc224/resourceGroups/LPTestRG/providers/Microsoft.PowerBIDedicated/capacities/pbiewi49626'
DEBUG: [Common.Authentication]: Authenticating using Account: 'Admin_User@domain.net', environment: 'AzureCloud', tenant: 't3n4nt1d-d+5g-dg6-5dg9d-d4g8df4g'
DEBUG: [Common.Authentication]: Authenticating using configuration values: Domain: 't3n4nt1d-d+5g-dg6-5dg9d-d4g8df4g', Endpoint: 'https://login.microsoftonline.com/', ClientId:
'cl13nt1d-h477d-85jff', ClientRedirect: 'urn:ietf:wg:oauth:2.0:oob', ResourceClientUri: 'https://management.core.windows.net/', ValidateAuthority: 'True'
DEBUG: [Common.Authentication]: Acquiring token using context with Authority 'https://login.microsoftonline.com/t3n4nt1d-d+5g-dg6-5dg9d-d4g8df4g/', CorrelationId: '00000000-0000-0000-0000-000000000000',
ValidateAuthority: 'True'
DEBUG: [Common.Authentication]: Acquiring token using AdalConfiguration with Domain: 't3n4nt1d-d+5g-dg6-5dg9d-d4g8df4g', AdEndpoint: 'https://login.microsoftonline.com/', ClientId:
'cl13nt1d-h477d-85jff', ClientRedirectUri: urn:ietf:wg:oauth:2.0:oob
DEBUG: [ADAL]: Information: 2020-06-15T17:10:59.0849141Z: 855c065f-d0fb-4c9f-9c69-b7cf0d62f3b0 - LoggerBase.cs: ADAL PCL.Desktop with assembly version '3.19.2.6005', file version '3.19.50302.0130' and
informational version '2a8bec6c4c76d0c1ef819b55bdc3cda2d2605056' is running...
DEBUG: [ADAL]: Information: 2020-06-15T17:10:59.0849141Z: 855c065f-d0fb-4c9f-9c69-b7cf0d62f3b0 - LoggerBase.cs: ADAL PCL.Desktop with assembly version '3.19.2.6005', file version '3.19.50302.0130' and
informational version '2a8bec6c4c76d0c1ef819b55bdc3cda2d2605056' is running...
DEBUG: [ADAL]: Information: 2020-06-15T17:10:59.0849141Z: 855c065f-d0fb-4c9f-9c69-b7cf0d62f3b0 - LoggerBase.cs: === Token Acquisition started:
 CacheType: null
 Authentication Target: User
 , Authority Host: login.microsoftonline.com
DEBUG: [ADAL]: Information: 2020-06-15T17:10:59.0849141Z: 855c065f-d0fb-4c9f-9c69-b7cf0d62f3b0 - LoggerBase.cs: === Token Acquisition started:
 Authority: https://login.microsoftonline.com/t3n4nt1d-d+5g-dg6-5dg9d-d4g8df4g/
 Resource: https://management.core.windows.net/
 ClientId: cl13nt1d-h477d-85jff
 CacheType: null
 Authentication Target: User

DEBUG: [ADAL]: Verbose: 2020-06-15T17:10:59.0859381Z: 855c065f-d0fb-4c9f-9c69-b7cf0d62f3b0 - LoggerBase.cs: Loading from cache.
DEBUG: [ADAL]: Verbose: 2020-06-15T17:10:59.0859381Z: 855c065f-d0fb-4c9f-9c69-b7cf0d62f3b0 - LoggerBase.cs: Loading from cache.
DEBUG: [ADAL]: Information: 2020-06-15T17:10:59.0879336Z: 00000000-0000-0000-0000-000000000000 - LoggerBase.cs: Deserialized 8 items to token cache.
DEBUG: [ADAL]: Verbose: 2020-06-15T17:10:59.0879336Z: 855c065f-d0fb-4c9f-9c69-b7cf0d62f3b0 - LoggerBase.cs: Looking up cache for a token...
DEBUG: [ADAL]: Verbose: 2020-06-15T17:10:59.0879336Z: 855c065f-d0fb-4c9f-9c69-b7cf0d62f3b0 - LoggerBase.cs: Looking up cache for a token...
DEBUG: [ADAL]: Information: 2020-06-15T17:10:59.0879336Z: 855c065f-d0fb-4c9f-9c69-b7cf0d62f3b0 - LoggerBase.cs: An item matching the requested resource was found in the cache
DEBUG: [ADAL]: Information: 2020-06-15T17:10:59.0879336Z: 855c065f-d0fb-4c9f-9c69-b7cf0d62f3b0 - LoggerBase.cs: An item matching the requested resource was found in the cache
DEBUG: [ADAL]: Information: 2020-06-15T17:10:59.0879336Z: 855c065f-d0fb-4c9f-9c69-b7cf0d62f3b0 - LoggerBase.cs: 25.3196677733333 minutes left until token in cache expires
DEBUG: [ADAL]: Information: 2020-06-15T17:10:59.0879336Z: 855c065f-d0fb-4c9f-9c69-b7cf0d62f3b0 - LoggerBase.cs: 25.3196677733333 minutes left until token in cache expires
DEBUG: [ADAL]: Information: 2020-06-15T17:10:59.0889295Z: 855c065f-d0fb-4c9f-9c69-b7cf0d62f3b0 - LoggerBase.cs: A matching item (access token or refresh token or both) was found in the cache
DEBUG: [ADAL]: Information: 2020-06-15T17:10:59.0889295Z: 855c065f-d0fb-4c9f-9c69-b7cf0d62f3b0 - LoggerBase.cs: A matching item (access token or refresh token or both) was found in the cache
DEBUG: [ADAL]: Information: 2020-06-15T17:10:59.0889295Z: 855c065f-d0fb-4c9f-9c69-b7cf0d62f3b0 - LoggerBase.cs: === Token Acquisition finished successfully. An access token was returned: Expiration Time:
15/06/2020 17:36:18 +00:00
DEBUG: [ADAL]: Information: 2020-06-15T17:10:59.0889295Z: 855c065f-d0fb-4c9f-9c69-b7cf0d62f3b0 - LoggerBase.cs: === Token Acquisition finished successfully. An access token was returned: Expiration Time:
15/06/2020 17:36:18 +00:00Access Token Hash: eg3mqkhnh8N1LFA4/ezffnIen24g5WEnFufkrOCpkN8=
  User id: 56201des-usr-dhdh64444j4j
DEBUG: [Common.Authentication]: Renewing Token with Type: 'Bearer', Expiry: '06/15/2020 17:36:18 +00:00', MultipleResource? 'True', Tenant: 't3n4nt1d-d+5g-dg6-5dg9d-d4g8df4g', UserId:
'Admin_User@domain.net'
DEBUG: [Common.Authentication]: User info for token DisplayId: 'Admin_User@domain.net', Name: Admin_User CloudAz1, IdProvider: 'https://sts.windows.net/t3n4nt1d-d+5g-dg6-5dg9d-d4g8df4g/', Uid:
'56201des-usr-dhdh64444j4j'
DEBUG: [Common.Authentication]: Checking token expiration, token expires '06/15/2020 17:36:18 +00:00' Comparing to '06/15/2020 17:10:59 +00:00' With threshold '00:05:00', calculated time until token expiry:
'00:25:19.1780794'
DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
GET

Absolute Uri:
https://management.azure.com//subscriptions/1fa2b345-67c2-890d-1ef2-aded8b8bc224/resourceGroups/LPTestRG/providers/Microsoft.PowerBIDedicated/capacities/pbiewi49626/providers/microsoft.insights/diagnosticSetting
s?api-version=2017-05-01-preview

Headers:
x-ms-client-request-id        : 4d399857-5d32-4423-8755-c80a2f459992
accept-language               : en-US

Body:

DEBUG: ============================ HTTP RESPONSE ============================

Status Code:
OK

Headers:
Pragma                        : no-cache
Strict-Transport-Security     : max-age=31536000; includeSubDomains
x-ms-request-id               : 5341b3d6-591d-4e29-8660-2907ab4effea
x-ms-ratelimit-remaining-subscription-reads: 11999
x-ms-correlation-request-id   : 852b26ae-2839-4b1c-8033-9cada52674cd
x-ms-routing-request-id       : UKSOUTH:20200615T171101Z:852b26ae-2839-4b1c-8033-9cada52674cd
X-Content-Type-Options        : nosniff
Cache-Control                 : no-cache
Date                          : Mon, 15 Jun 2020 17:11:00 GMT
Server                        : Microsoft-IIS/10.0

Body:
{
  "value": []
}

DEBUG: 18:11:00 - Diagnostic setting named: 'settings1' not found in list of 0 settings. Creating a new one.
DEBUG: 18:11:00 - Retrieving supported categories for resource: '/subscriptions/1fa2b345-67c2-890d-1ef2-aded8b8bc224/resourceGroups/LPTestRG/providers/Microsoft.PowerBIDedicated/capacities/pbiewi49626'
DEBUG: [Common.Authentication]: Renewing Token with Type: 'Bearer', Expiry: '06/15/2020 17:36:18 +00:00', MultipleResource? 'True', Tenant: 't3n4nt1d-d+5g-dg6-5dg9d-d4g8df4g', UserId:
'Admin_User@domain.net'
DEBUG: [Common.Authentication]: User info for token DisplayId: 'Admin_User@domain.net', Name: Admin_User CloudAz1, IdProvider: 'https://sts.windows.net/t3n4nt1d-d+5g-dg6-5dg9d-d4g8df4g/', Uid:
'56201des-usr-dhdh64444j4j'
DEBUG: [Common.Authentication]: Checking token expiration, token expires '06/15/2020 17:36:18 +00:00' Comparing to '06/15/2020 17:11:00 +00:00' With threshold '00:05:00', calculated time until token expiry:
'00:25:17.4441524'
DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
GET

Absolute Uri:
https://management.azure.com//subscriptions/1fa2b345-67c2-890d-1ef2-aded8b8bc224/resourceGroups/LPTestRG/providers/Microsoft.PowerBIDedicated/capacities/pbiewi49626/providers/microsoft.insights/diagnosticSetting
sCategories?api-version=2017-05-01-preview

Headers:
x-ms-client-request-id        : 7f48e539-e79f-40f8-baf3-ed6587498754
accept-language               : en-US

Body:

DEBUG: ============================ HTTP RESPONSE ============================

Status Code:
OK

Headers:
Pragma                        : no-cache
Strict-Transport-Security     : max-age=31536000; includeSubDomains
x-ms-request-id               : c8e17670-15f7-4755-be04-42ed44bd4054
x-ms-ratelimit-remaining-subscription-reads: 11998
x-ms-correlation-request-id   : d4903bc3-27bc-430f-a0db-94f5e280f9a2
x-ms-routing-request-id       : UKSOUTH:20200615T171101Z:d4903bc3-27bc-430f-a0db-94f5e280f9a2
X-Content-Type-Options        : nosniff
Cache-Control                 : no-cache
Date                          : Mon, 15 Jun 2020 17:11:00 GMT
Server                        : Microsoft-IIS/10.0

Body:
{
  "value": [
    {
      "id":
"/subscriptions/1fa2b345-67c2-890d-1ef2-aded8b8bc224/resourcegroups/lptestrg/providers/microsoft.powerbidedicated/capacities/pbiewi49626/providers/microsoft.insights/diagnosticSettingsCategories/Engine",
      "type": "microsoft.insights/diagnosticSettingsCategories",
      "name": "Engine",
      "location": null,
      "kind": null,
      "tags": null,
      "properties": {
        "categoryType": "Logs"
      },
      "identity": null
    },
    {
      "id":
"/subscriptions/1fa2b345-67c2-890d-1ef2-aded8b8bc224/resourcegroups/lptestrg/providers/microsoft.powerbidedicated/capacities/pbiewi49626/providers/microsoft.insights/diagnosticSettingsCategories/AllMetrics",
      "type": "microsoft.insights/diagnosticSettingsCategories",
      "name": "AllMetrics",
      "location": null,
      "kind": null,
      "tags": null,
      "properties": {
        "categoryType": "Metrics"
      },
      "identity": null
    }
  ]
}

DEBUG: 18:11:01 - Setting supported categories for resource: '/subscriptions/1fa2b345-67c2-890d-1ef2-aded8b8bc224/resourceGroups/LPTestRG/providers/Microsoft.PowerBIDedicated/capacities/pbiewi49626'
DEBUG: 18:11:01 - Merging data. Existing setting is: not null
DEBUG: 18:11:01 - Setting storage account Id
DEBUG: 18:11:01 - Changing the enable properties
DEBUG: 18:11:01 - Setting Enabled property for logs
DEBUG: 18:11:01 - Setting Enabled property for metrics
DEBUG: 18:11:01 - Copying diagnostic settings
DEBUG: 18:11:01 - Sending create/update request setting: settings1
DEBUG: [Common.Authentication]: Renewing Token with Type: 'Bearer', Expiry: '06/15/2020 17:36:18 +00:00', MultipleResource? 'True', Tenant: 't3n4nt1d-d+5g-dg6-5dg9d-d4g8df4g', UserId:
'Admin_User@domain.net'
DEBUG: [Common.Authentication]: User info for token DisplayId: 'Admin_User@domain.net', Name: Admin_User CloudAz1, IdProvider: 'https://sts.windows.net/t3n4nt1d-d+5g-dg6-5dg9d-d4g8df4g/', Uid:
'56201des-usr-dhdh64444j4j'
DEBUG: [Common.Authentication]: Checking token expiration, token expires '06/15/2020 17:36:18 +00:00' Comparing to '06/15/2020 17:11:01 +00:00' With threshold '00:05:00', calculated time until token expiry:
'00:25:17.1090132'
DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
PUT

Absolute Uri:
https://management.azure.com//subscriptions/1fa2b345-67c2-890d-1ef2-aded8b8bc224/resourceGroups/LPTestRG/providers/Microsoft.PowerBIDedicated/capacities/pbiewi49626/providers/microsoft.insights/diagnosticSetting
s/settings1?api-version=2017-05-01-preview

Headers:
x-ms-client-request-id        : 0d619b06-52e5-40e2-84f2-a658f2d5e572
accept-language               : en-US

Body:
{
  "properties": {
    "storageAccountId": "/subscriptions/1fa2b345-67c2-890d-1ef2-aded8b8bc224/resourceGroups/LPTestRG/providers/Microsoft.Storage/storageAccounts/lptestsa",
    "metrics": [
      {
        "category": "AllMetrics",
        "enabled": true
      }
    ],
    "logs": [
      {
        "category": "Engine",
        "enabled": true
      }
    ]
  }
}

DEBUG: ============================ HTTP RESPONSE ============================

Status Code:
Conflict

Headers:
Pragma                        : no-cache
Strict-Transport-Security     : max-age=31536000; includeSubDomains
x-ms-request-id               : 00000000-0000-0000-0000-000000000000
x-ms-ratelimit-remaining-subscription-resource-requests: 149
x-ms-correlation-request-id   : 95e37308-74e4-4f5b-a919-e13efd2a6b61
x-ms-routing-request-id       : UKSOUTH:20200615T171103Z:95e37308-74e4-4f5b-a919-e13efd2a6b61
X-Content-Type-Options        : nosniff
Cache-Control                 : no-cache
Date                          : Mon, 15 Jun 2020 17:11:02 GMT
Server                        : Microsoft-IIS/10.0

Body:
{
  "code": "Conflict",
  "message": "Storage account '/subscriptions/1fa2b345-67c2-890d-1ef2-aded8b8bc224/resourcegroups/lptestrg/providers/microsoft.storage/storageaccounts/lptestsa' is not accessible yet. Try again when storage
provisioning is complete."
}

Error output

Resolve-AzError -Last                                                                                                                                                                                WARNING: Breaking changes in the cmdlet 'Resolve-AzError' :
WARNING:  - The `Resolve-Error` alias will be removed in a future release.  Please change any scripts that use this alias to use `Resolve-AzError` instead.

WARNING: NOTE : Go to https://aka.ms/azps-changewarnings for steps to suppress this breaking change warning, and other information on breaking changes in Azure PowerShell.

   HistoryId: 37

Message        : Exception type: ErrorResponseException, Message: Storage account
                 '/subscriptions/1fa2b345-67c2-890d-1ef2-aded8b8bc224/resourcegroups/lptestrg/providers/microsoft.storage/storageaccounts/lptestsa' is not accessible yet. Try again when storage provisioning is
                 complete., Code: Conflict, Status code:Conflict, Reason phrase: Conflict
StackTrace     :    at Microsoft.Azure.Commands.Insights.MonitorCmdletBase.ExecuteCmdlet()
                    at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord()
Exception      : System.Management.Automation.PSInvalidOperationException
InvocationInfo : {Set-AzDiagnosticSetting}
Line           : Set-AzDiagnosticSetting -ResourceId $PBIECapacity.Id -Name settings1 -Enabled $true -StorageAccountId $BlobStorageAccount.Id
Position       : At line:1 char:1
                 + Set-AzDiagnosticSetting -ResourceId $PBIECapacity.Id -Name settings1  ...
                 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId      : 37

Message        : Operation returned an invalid status code 'Conflict'
StackTrace     :    at Microsoft.Azure.Management.Monitor.DiagnosticSettingsOperations.<CreateOrUpdateWithHttpMessagesAsync>d__6.MoveNext()
                 --- End of stack trace from previous location where exception was thrown ---
                    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
                    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
                    at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
                    at Microsoft.Azure.Management.Monitor.DiagnosticSettingsOperationsExtensions.<CreateOrUpdateAsync>d__3.MoveNext()
Exception      : Microsoft.Azure.Management.Monitor.Models.ErrorResponseException
InvocationInfo : {Set-AzDiagnosticSetting}
Line           : Set-AzDiagnosticSetting -ResourceId $PBIECapacity.Id -Name settings1 -Enabled $true -StorageAccountId $BlobStorageAccount.Id
Position       : At line:1 char:1
                 + Set-AzDiagnosticSetting -ResourceId $PBIECapacity.Id -Name settings1  ...
                 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId      : 37

The Azure PowerShell team is listening, please let us know how we are doing: https://aka.ms/azpssurvey?Q_CHL=ERROR.
dingmeng-xue commented 4 years ago

@Panzerbjrn , according to the response from server, the provision of storage account was not finished yet. Did you try it after a while? Could you share the debug message further?

Panzerbjrn commented 4 years ago

Thanks @dingmeng-xue , as I wrote, although it was mangled a bit by formatting: Running Get-AzStorageAccount and looking in the portal, I can see that provisioning has succeeded, and I have a bunch of blobs and tables in there anyway, so I know that it works.

The Storage account I tried first had been in use for a few months, and I also created a brand new one, added some tables and blobs, and then got the same error when trying Set-AzDiagnosticSetting.

The debug message is the full message that appears in my console.

VeryEarly commented 4 years ago

Hi @Panzerbjrn ,

I tried with storage account I created, had no problem with the diagnostic setting.

Is it possible the storage account you are using is different from mine?

dingmeng-xue commented 4 years ago

@Panzerbjrn , could you provide details information how you created storage account? We will try to reproduce it and identify which service has the problem, either storage account API doesn't return correct status or diagnostic setting needs provide clear information.

dingmeng-xue commented 4 years ago

@Panzerbjrn , could you respond to @VeryEearly 's question?

dingmeng-xue commented 4 years ago

@Panzerbjrn , we cannot reproduce this issue. I believe it is related to this storage account. I'm closing this issue now. If you have further information, please let us know.