-
Notifications
You must be signed in to change notification settings - Fork 4k
Closed
Closed
Copy link
Labels
AccountsIssues in Az.Accounts except authentication relatedIssues in Az.Accounts except authentication relatedAutomationAzure PS TeamTrackingWe will track status and follow internallyWe will track status and follow internallybugThis issue requires a change to an existing behavior in the product in order to be resolved.This issue requires a change to an existing behavior in the product in order to be resolved.
Description
Description
Azure Automation allows customers to run PowerShell scripts as runbooks. We recently published a new Docker image for PowerShell 5.1 with Az module version 11.2.0, which includes Az.Identity v3.0.4. After switching to this image, we started encountering a warning in the Connect-AzAccount cmdlet.
Reproduction Steps:
- Create an Azure Automation Account.
- Upload Az.Accounts v3.0.4 as a custom module.
- Create a PowerShell 5.1 runbook in Azure Automation.
- Author the runbook with the following content:
Connect-AzAccount -Identity - Publish the runbook.
- Run the runbook.
- Check the job logs, where you will see the following warning message:
Exception calling "Initialize" with "1" argument(s): "Object reference not set to an instance of an object."
This warning does not occur when using Az.Accounts v2.15.0.
Issue script & Debug output
Get-Module -listavailable
Disable-AzContextAutosave -Scope Process
Connect-azaccount -identity
Environment data
Name Value
---- -----
PSVersion 5.1.17763.6189
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.17763.6189
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Module versions
Directory: C:\usr\src\PSModules
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Binary 1.0 Automation.Sandbox.AssetManageme... {Get-AutomationVariable, Set-AutomationVariable, Get-Automa...
Directory: C:\AzAt\Modules\11.2.0
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Script 3.0.4 Az.Accounts {Disable-AzDataCollection, Disable-AzContextAutosave, Enabl...
Script 2.0.0 Az.Advisor {Disable-AzAdvisorRecommendation, Enable-AzAdvisorRecommend...
Script 6.0.0 Az.Aks {Get-AzAksCluster, New-AzAksCluster, Remove-AzAksCluster, I...
Script 1.1.4 Az.AnalysisServices {Resume-AzAnalysisServicesServer, Suspend-AzAnalysisService...
Script 4.0.2 Az.ApiManagement {Add-AzApiManagementApiToGateway, Add-AzApiManagementApiToP...
Script 1.0.0 Az.App {Disable-AzContainerAppRevision, Enable-AzContainerAppRevis...
Script 1.3.0 Az.AppConfiguration {Get-AzAppConfigurationStore, Get-AzAppConfigurationStoreKe...
Script 2.2.3 Az.ApplicationInsights {Get-AzApplicationInsights, Get-AzApplicationInsightsApiKey...
Script 1.0.0 Az.ArcResourceBridge {Get-AzArcResourceBridge, Get-AzArcResourceBridgeApplianceC...
Script 2.0.0 Az.Attestation {Get-AzAttestationPolicy, Set-AzAttestationPolicy, Reset-Az...
Script 1.0.0 Az.Automanage {Get-AzAutomanageBestPractice, Get-AzAutomanageConfigProfil...
Script 1.10.0 Az.Automation {Export-AzAutomationDscConfiguration, Export-AzAutomationDs...
Script 3.5.0 Az.Batch {Remove-AzBatchAccount, Get-AzBatchAccount, Get-AzBatchAcco...
Script 2.0.3 Az.Billing {Get-AzBillingInvoice, Get-AzBillingPeriod, Get-AzEnrollmen...
Script 3.1.1 Az.Cdn {Clear-AzCdnEndpointContent, Clear-AzFrontDoorCdnEndpointCo...
Script 2.0.0 Az.CloudService {Get-AzCloudService, Get-AzCloudServiceInstanceView, Get-Az...
Script 1.14.1 Az.CognitiveServices {Get-AzCognitiveServicesAccount, Get-AzCognitiveServicesAcc...
Script 7.1.1 Az.Compute {Add-AzImageDataDisk, Add-AzVhd, Add-AzVMAdditionalUnattend...
Script 1.0.0 Az.ConfidentialLedger {Get-AzConfidentialLedger, New-AzConfidentialLedger, New-Az...
Script 4.0.0 Az.ContainerInstance {Add-AzContainerInstanceOutput, Get-AzContainerGroup, Get-A...
Script 4.1.3 Az.ContainerRegistry {Connect-AzContainerRegistry, Get-AzContainerRegistryManife...
Script 1.14.0 Az.CosmosDB {Get-AzCosmosDBAccount, Get-AzCosmosDBAccountKey, Get-AzCos...
Script 1.1.0 Az.DataBoxEdge {Get-AzDataBoxEdgeJob, Get-AzDataBoxEdgeDevice, Invoke-AzDa...
Script 1.7.1 Az.Databricks {Get-AzDatabricksAccessConnector, Get-AzDatabricksOutboundN...
Script 1.18.0 Az.DataFactory {Set-AzDataFactoryV2, Update-AzDataFactoryV2, Get-AzDataFac...
Script 1.0.3 Az.DataLakeAnalytics {Get-AzDataLakeAnalyticsDataSource, New-AzDataLakeAnalytics...
Script 1.3.0 Az.DataLakeStore {Get-AzDataLakeStoreTrustedIdProvider, Remove-AzDataLakeSto...
Script 2.2.0 Az.DataProtection {Backup-AzDataProtectionBackupInstanceAdhoc, Edit-AzDataPro...
Script 1.0.1 Az.DataShare {New-AzDataShareAccount, Get-AzDataShareAccount, Remove-AzD...
Script 1.1.0 Az.DeploymentManager {Get-AzDeploymentManagerArtifactSource, New-AzDeploymentMan...
Script 4.3.0 Az.DesktopVirtualization {Disconnect-AzWvdUserSession, Expand-AzWvdMsixImage, Get-Az...
Script 1.1.0 Az.DevCenter {Deploy-AzDevCenterUserEnvironment, Get-AzDevCenterAdminAtt...
Script 1.0.2 Az.DevTestLabs {Get-AzDtlAllowedVMSizesPolicy, Get-AzDtlAutoShutdownPolicy...
Script 1.2.0 Az.Dns {Get-AzDnsRecordSet, New-AzDnsRecordConfig, Remove-AzDnsRec...
Script 1.6.0 Az.EventGrid {New-AzEventGridTopic, Get-AzEventGridTopic, Set-AzEventGri...
Script 4.2.0 Az.EventHub {New-AzEventHubAuthorizationRuleSASToken, Approve-AzEventHu...
Script 1.10.0 Az.FrontDoor {New-AzFrontDoor, Get-AzFrontDoor, Set-AzFrontDoor, Remove-...
Script 4.0.7 Az.Functions {Get-AzFunctionApp, Get-AzFunctionAppAvailableLocation, Get...
Script 6.1.0 Az.HDInsight {Add-AzHDInsightClusterIdentity, Add-AzHDInsightComponentVe...
Script 2.0.0 Az.HealthcareApis {Get-AzHealthcareApisService, Get-AzHealthcareApisWorkspace...
Script 2.7.5 Az.IotHub {Add-AzIotHubKey, Get-AzIotHubEventHubConsumerGroup, Get-Az...
Script 5.1.0 Az.KeyVault {Add-AzKeyVaultCertificate, Add-AzKeyVaultCertificateContac...
Script 2.3.0 Az.Kusto {Add-AzKustoClusterLanguageExtension, Add-AzKustoDatabasePr...
Script 1.0.0 Az.LoadTesting {Get-AzLoad, New-AzLoad, Remove-AzLoad, Update-AzLoad}
Script 1.5.0 Az.LogicApp {Get-AzIntegrationAccountAgreement, Get-AzIntegrationAccoun...
Script 1.1.3 Az.MachineLearning {Move-AzMlCommitmentAssociation, Get-AzMlCommitmentAssociat...
Script 1.0.0 Az.MachineLearningServices {Get-AzMLServiceQuota, Get-AzMLServiceUsage, Get-AzMLServic...
Script 1.4.1 Az.Maintenance {Get-AzApplyUpdate, Get-AzConfigurationAssignment, Get-AzMa...
Script 1.2.0 Az.ManagedServiceIdentity {Get-AzSystemAssignedIdentity, Get-AzUserAssignedIdentity, ...
Script 3.0.0 Az.ManagedServices {Get-AzManagedServicesAssignment, Get-AzManagedServicesDefi...
Script 2.0.0 Az.MarketplaceOrdering {Get-AzMarketplaceTerms, Invoke-AzMarketplaceSignTerms, Set...
Script 1.1.2 Az.Media {Sync-AzMediaServiceStorageKey, Set-AzMediaServiceKey, Get-...
Script 2.2.0 Az.Migrate {Get-AzMigrateDiscoveredServer, Get-AzMigrateJob, Get-AzMig...
Script 5.0.0 Az.Monitor {Get-AzMetricDefinition, Get-AzMetric, Remove-AzLogProfile,...
Script 1.1.1 Az.MySql {Get-AzMySqlConfiguration, Get-AzMySqlConnectionString, Get...
Script 7.3.0 Az.Network {Add-AzApplicationGatewayAuthenticationCertificate, Add-AzA...
Script 1.0.0 Az.NetworkCloud {Deploy-AzNetworkCloudCluster, Disable-AzNetworkCloudStorag...
Script 1.1.2 Az.NotificationHubs {Get-AzNotificationHub, Get-AzNotificationHubAuthorizationR...
Script 3.2.0 Az.OperationalInsights {New-AzOperationalInsightsAzureActivityLogDataSource, New-A...
Script 1.6.4 Az.PolicyInsights {Get-AzPolicyEvent, Get-AzPolicyState, Get-AzPolicyStateSum...
Script 1.1.0 Az.PostgreSql {Get-AzPostgreSqlConfiguration, Get-AzPostgreSqlConnectionS...
Script 2.0.0 Az.PowerBIEmbedded {Resume-AzPowerBIEmbeddedCapacity, Suspend-AzPowerBIEmbedde...
Script 1.0.4 Az.PrivateDns {Get-AzPrivateDnsZone, Remove-AzPrivateDnsZone, Set-AzPriva...
Script 6.7.0 Az.RecoveryServices {Add-AzRecoveryServicesAsrReplicationProtectedItemDisk, Bac...
Script 1.8.1 Az.RedisCache {Remove-AzRedisCachePatchSchedule, New-AzRedisCacheSchedule...
Script 1.2.0 Az.RedisEnterpriseCache {Export-AzRedisEnterpriseCache, Get-AzRedisEnterpriseCache,...
Script 2.0.0 Az.Relay {Get-AzRelayAuthorizationRule, Get-AzRelayHybridConnection,...
Script 1.2.0 Az.ResourceMover {Add-AzResourceMoverMoveResource, Get-AzResourceMoverMoveCo...
Script 6.13.0 Az.Resources {Export-AzResourceGroup, Export-AzTemplateSpec, Get-AzDenyA...
Script 1.5.1 Az.Security {Get-AzSecuritySolution, Get-AzSecuritySolutionsReferenceDa...
Script 3.1.1 Az.SecurityInsights {Get-AzSentinelAlertRule, Get-AzSentinelAlertRuleAction, Ge...
Script 3.0.0 Az.ServiceBus {New-AzServiceBusAuthorizationRuleSASToken, Test-AzServiceB...
Script 3.3.2 Az.ServiceFabric {Add-AzServiceFabricClientCertificate, Add-AzServiceFabricM...
Script 2.0.0 Az.SignalR {New-AzSignalR, Get-AzSignalR, Get-AzSignalRKey, New-AzSign...
Script 4.13.0 Az.Sql {Add-AzSqlDatabaseToFailoverGroup, Add-AzSqlElasticJobStep,...
Script 2.1.0 Az.SqlVirtualMachine {Get-AzAvailabilityGroupListener, Get-AzSqlVM, Get-AzSqlVMG...
Script 2.2.3 Az.StackHCI {Add-AzStackHCIVMAttestation, Disable-AzStackHCIAttestation...
Script 6.1.0 Az.Storage {Add-AzRmStorageContainerLegalHold, Add-AzStorageAccountMan...
Script 1.3.0 Az.StorageMover {Get-AzStorageMover, Get-AzStorageMoverAgent, Get-AzStorage...
Script 2.1.1 Az.StorageSync {Get-AzStorageSyncCloudEndpoint, Get-AzStorageSyncGroup, Ge...
Script 2.0.0 Az.StreamAnalytics {Get-AzStreamAnalyticsCluster, Get-AzStreamAnalyticsCluster...
Script 1.0.0 Az.Support {Get-AzSupportService, Get-AzSupportProblemClassification, ...
Script 3.0.5 Az.Synapse {Add-AzSynapseDataFlowDebugSessionPackage, Add-AzSynapseTri...
Script 1.2.2 Az.TrafficManager {Add-AzTrafficManagerCustomHeaderToEndpoint, Remove-AzTraff...
Script 3.1.2 Az.Websites {Get-AzAppServicePlan, Set-AzAppServicePlan, New-AzAppServi...
Error output
Warning:-Exception calling "Initialize" with "1" argument(s): "Object reference not set to an instance of an object."
Metadata
Metadata
Assignees
Labels
AccountsIssues in Az.Accounts except authentication relatedIssues in Az.Accounts except authentication relatedAutomationAzure PS TeamTrackingWe will track status and follow internallyWe will track status and follow internallybugThis issue requires a change to an existing behavior in the product in order to be resolved.This issue requires a change to an existing behavior in the product in order to be resolved.