PS C:\Users\Rohit> F:\Powershell Script\creationnewvm.ps1 Please select the account you want to login with. Retrieving subscriptions for the selection... Subscription name Tenant ----------------- ------ Free Trial Default Directory SubscriptionName SubscriptionId ---------------- -------------- 9896b81a-ef21-45ad-8577-f6adde85abea Switched to subscription: 9896b81a-ef21-45ad-8577-f6adde85abea Resource Group mynewresourcegroup already exists. Virtual Network myVNet already exists. Subnet mySubnet already exists. Network Interface myNIC already exists. DEBUG: 11:28:20 - [ConfigManager] Got nothing from [DisplaySecretsWarning], Module = [], Cmdlet = []. Returning default value [True]. DEBUG: 11:28:22 - NewAzureVMCommand begin processing with ParameterSet 'DefaultParameterSet'. DEBUG: 11:28:22 - using account id 'ujjvalmahajan2001@hotmail.com'... DEBUG: 11:28:22 - [ConfigManager] Got nothing from [DisplayBreakingChangeWarning], Module = [], Cmdlet = []. Returning default value [True]. DEBUG: [Common.Authentication]: Authenticating using Account: 'ujjvalmahajan2001@hotmail.com', environment: 'AzureCloud', tenant: '48e1c7ee-3b88-41c9-bead-f016a22ee06d' DEBUG: 11:28:22 - [ConfigManager] Got nothing from [DisableInstanceDiscovery], Module = [], Cmdlet = []. Returning default value [False]. DEBUG: 11:28:22 - [ConfigManager] Got [False] from [EnableLoginByWam], Module = [], Cmdlet = []. DEBUG: 11:28:22 - [SilentAuthenticator] Calling SharedTokenCacheCredential.GetTokenAsync - TenantId:'48e1c7ee-3b88-41c9-bead-f016a22ee06d', Scopes:'https://management.core.windows.net//.default', AuthorityHost:'htt ps://login.microsoftonline.com/', UserId:'ujjvalmahajan2001@hotmail.com' DEBUG: SharedTokenCacheCredential.GetToken invoked. Scopes: [ https://management.core.windows.net//.default ] ParentRequestId: DEBUG: False MSAL 4.61.3.0 MSAL.CoreCLR .NET Framework 4.8.9261.0 Microsoft Windows 10.0.19045 [2024-09-11 05:58:22Z - 5b16465e-3b7b-44ed-978b-564a5ac9b09b] IsLegacyAdalCacheEnabled: yes DEBUG: False MSAL 4.61.3.0 MSAL.CoreCLR .NET Framework 4.8.9261.0 Microsoft Windows 10.0.19045 [2024-09-11 05:58:22Z - 5b16465e-3b7b-44ed-978b-564a5ac9b09b] [Region discovery] Not using a regional authority. DEBUG: False MSAL 4.61.3.0 MSAL.CoreCLR .NET Framework 4.8.9261.0 Microsoft Windows 10.0.19045 [2024-09-11 05:58:22Z - 5b16465e-3b7b-44ed-978b-564a5ac9b09b] [Region discovery] Not using a regional authority. DEBUG: False MSAL 4.61.3.0 MSAL.CoreCLR .NET Framework 4.8.9261.0 Microsoft Windows 10.0.19045 [2024-09-11 05:58:22Z - 5b16465e-3b7b-44ed-978b-564a5ac9b09b] [Region discovery] Not using a regional authority. DEBUG: False MSAL 4.61.3.0 MSAL.CoreCLR .NET Framework 4.8.9261.0 Microsoft Windows 10.0.19045 [2024-09-11 05:58:22Z - 5b16465e-3b7b-44ed-978b-564a5ac9b09b] IsLegacyAdalCacheEnabled: yes DEBUG: False MSAL 4.61.3.0 MSAL.CoreCLR .NET Framework 4.8.9261.0 Microsoft Windows 10.0.19045 [2024-09-11 05:58:22Z - 5b16465e-3b7b-44ed-978b-564a5ac9b09b] IsLegacyAdalCacheEnabled: yes DEBUG: False MSAL 4.61.3.0 MSAL.CoreCLR .NET Framework 4.8.9261.0 Microsoft Windows 10.0.19045 [2024-09-11 05:58:22Z] Found 2 cache accounts and 0 broker accounts DEBUG: False MSAL 4.61.3.0 MSAL.CoreCLR .NET Framework 4.8.9261.0 Microsoft Windows 10.0.19045 [2024-09-11 05:58:22Z] Returning 2 accounts DEBUG: False MSAL 4.61.3.0 MSAL.CoreCLR .NET Framework 4.8.9261.0 Microsoft Windows 10.0.19045 [2024-09-11 05:58:22Z - 9d122683-d061-4093-994d-e894a7c8d952] MSAL MSAL.CoreCLR with assembly version '4.61.3.0'. Corr elationId(9d122683-d061-4093-994d-e894a7c8d952) DEBUG: False MSAL 4.61.3.0 MSAL.CoreCLR .NET Framework 4.8.9261.0 Microsoft Windows 10.0.19045 [2024-09-11 05:58:22Z - 9d122683-d061-4093-994d-e894a7c8d952] === AcquireTokenSilent Parameters === DEBUG: False MSAL 4.61.3.0 MSAL.CoreCLR .NET Framework 4.8.9261.0 Microsoft Windows 10.0.19045 [2024-09-11 05:58:22Z - 9d122683-d061-4093-994d-e894a7c8d952] LoginHint provided: False DEBUG: False MSAL 4.61.3.0 MSAL.CoreCLR .NET Framework 4.8.9261.0 Microsoft Windows 10.0.19045 [2024-09-11 05:58:22Z - 9d122683-d061-4093-994d-e894a7c8d952] Account provided: True DEBUG: False MSAL 4.61.3.0 MSAL.CoreCLR .NET Framework 4.8.9261.0 Microsoft Windows 10.0.19045 [2024-09-11 05:58:22Z - 9d122683-d061-4093-994d-e894a7c8d952] ForceRefresh: False DEBUG: False MSAL 4.61.3.0 MSAL.CoreCLR .NET Framework 4.8.9261.0 Microsoft Windows 10.0.19045 [2024-09-11 05:58:22Z - 9d122683-d061-4093-994d-e894a7c8d952] === 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 - 9d122683-d061-4093-994d-e894a7c8d952 UserAssertion set: False LongRunningOboCacheKey set: False Region configured: DEBUG: False MSAL 4.61.3.0 MSAL.CoreCLR .NET Framework 4.8.9261.0 Microsoft Windows 10.0.19045 [2024-09-11 05:58:22Z - 9d122683-d061-4093-994d-e894a7c8d952] === Token Acquisition (SilentRequest) started: Scopes: https://management.core.windows.net//.default Authority Host: login.microsoftonline.com DEBUG: False MSAL 4.61.3.0 MSAL.CoreCLR .NET Framework 4.8.9261.0 Microsoft Windows 10.0.19045 [2024-09-11 05:58:22Z - 9d122683-d061-4093-994d-e894a7c8d952] [Region discovery] Not using a regional authority. DEBUG: False MSAL 4.61.3.0 MSAL.CoreCLR .NET Framework 4.8.9261.0 Microsoft Windows 10.0.19045 [2024-09-11 05:58:22Z - 9d122683-d061-4093-994d-e894a7c8d952] Access token is not expired. Returning the found cache e ntry. [Current time (09/11/2024 05:58:22) - Expiration Time (09/11/2024 06:26:39 +00:00) - Extended Expiration Time (09/11/2024 06:26:39 +00:00)] DEBUG: False MSAL 4.61.3.0 MSAL.CoreCLR .NET Framework 4.8.9261.0 Microsoft Windows 10.0.19045 [2024-09-11 05:58:22Z - 9d122683-d061-4093-994d-e894a7c8d952] Returning access token found in cache. RefreshOn exists ? False DEBUG: False MSAL 4.61.3.0 MSAL.CoreCLR .NET Framework 4.8.9261.0 Microsoft Windows 10.0.19045 [2024-09-11 05:58:22Z - 9d122683-d061-4093-994d-e894a7c8d952] [Region discovery] Not using a regional authority. DEBUG: False MSAL 4.61.3.0 MSAL.CoreCLR .NET Framework 4.8.9261.0 Microsoft Windows 10.0.19045 [2024-09-11 05:58:22Z - 9d122683-d061-4093-994d-e894a7c8d952] === Token Acquisition finished successfully: DEBUG: False MSAL 4.61.3.0 MSAL.CoreCLR .NET Framework 4.8.9261.0 Microsoft Windows 10.0.19045 [2024-09-11 05:58:22Z - 9d122683-d061-4093-994d-e894a7c8d952] AT expiration time: 11-09-2024 06:26:39 +00:00, scopes: https://management.core.windows.net//.default https://management.core.windows.net//user_impersonation. source: Cache DEBUG: SharedTokenCacheCredential.GetToken succeeded. Scopes: [ https://management.core.windows.net//.default ] ParentRequestId: ExpiresOn: 2024-09-11T06:26:39.0000000+00:00 DEBUG: [Common.Authentication]: Received token with LoginType 'User', Tenant: '48e1c7ee-3b88-41c9-bead-f016a22ee06d', UserId: 'ujjvalmahajan2001@hotmail.com' DEBUG: ============================ HTTP REQUEST ============================ HTTP Method: POST Absolute Uri: https://management.azure.com/subscriptions/9896b81a-ef21-45ad-8577-f6adde85abea/providers/Microsoft.Storage/checkNameAvailability?api-version=2021-02-01 Headers: x-ms-client-request-id : f2143c05-e286-45d1-a9ac-b440d1e1482b accept-language : en-US Body: { "name": "freemynewrmyvm091111280", "type": "Microsoft.Storage/storageAccounts" } DEBUG: ============================ HTTP RESPONSE ============================ Status Code: NotFound Headers: Pragma : no-cache x-ms-request-id : 5f33ea7b-d149-49f7-aa7d-a68b8d6f278f Strict-Transport-Security : max-age=31536000; includeSubDomains x-ms-ratelimit-remaining-subscription-reads: 499 x-ms-ratelimit-remaining-subscription-global-reads: 7499 x-ms-correlation-request-id : 0dcfe826-21c5-48f6-bd0c-64d877417915 x-ms-routing-request-id : CENTRALINDIA:20240911T055822Z:0dcfe826-21c5-48f6-bd0c-64d877417915 X-Content-Type-Options : nosniff X-Cache : CONFIG_NOCACHE X-MSEdge-Ref : Ref A: 2A84403E83BB497E8E6CEDBFB5B422D7 Ref B: MAA201060515033 Ref C: 2024-09-11T05:58:21Z Cache-Control : no-cache Date : Wed, 11 Sep 2024 05:58:21 GMT Body: { "error": { "code": "SubscriptionNotFound", "message": "Subscription 9896b81a-ef21-45ad-8577-f6adde85abea was not found." } } DEBUG: 11:28:23 - [ConfigManager] Got nothing from [EnableErrorRecordsPersistence], Module = [], Cmdlet = []. Returning default value [False]. Tenant: Default Directory (48e1c7ee-3b88-41c9-bead-f016a22ee06d) SubscriptionName SubscriptionId Account Environment ---------------- -------------- ------- ----------- Free Trial 9896b81a-ef21-45ad-8577-f6adde85abea ujjvalmahajan2001@hotmail.com AzureCloud New-AzVM : Subscription 9896b81a-ef21-45ad-8577-f6adde85abea was not found. At F:\Powershell Script\creationnewvm.ps1:89 char:5 + New-AzVM -ResourceGroupName $resourceGroupName -Location $locatio ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : CloseError: (:) [New-AzVM], CloudException + FullyQualifiedErrorId : Microsoft.Azure.Commands.Compute.NewAzureVMCommand DEBUG: 11:28:24 - [ConfigManager] Got nothing from [DisplayBreakingChangeWarning], Module = [], Cmdlet = []. Returning default value [True]. DEBUG: 11:28:24 - [ConfigManager] Got nothing from [DisplayRegionIdentified], Module = [], Cmdlet = []. Returning default value [True]. DEBUG: 11:28:24 - [ConfigManager] Got nothing from [CheckForUpgrade], Module = [], Cmdlet = []. Returning default value [True]. DEBUG: AzureQoSEvent: Module: Az.Compute:8.3.0; CommandName: New-AzVM; PSVersion: 5.1.19041.4780; IsSuccess: False; Duration: 00:00:04.2948128; SanitizeDuration: 00:00:00; Exception: Subscription 9896b81a-ef21-45a d-8577-f6adde85abea was not found.; DEBUG: 11:28:24 - [ConfigManager] Got nothing from [EnableDataCollection], Module = [], Cmdlet = []. Returning default value [True]. DEBUG: 11:28:24 - NewAzureVMCommand end processing. VM myVM created successfully in resource group mynewresourcegroup!