Coder Social home page Coder Social logo

azurestack-powershell's Introduction

Welcome to AzureStack Powershell repository!

The repository contains the powershell cmdlets for the AzureStack Hub Operator APIs. For the install instructions, please refer to https://aka.ms/azspsh.

The developer documentation can be found at https://github.com/Azure/azurestack-powershell/wiki/Getting-Started

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

azurestack-powershell's People

Contributors

anusapan avatar azdevxps avatar bendavms avatar bganapa avatar caross avatar cheguv avatar cormacpayne avatar daozha avatar deathly809 avatar dragav avatar hannah-murphy-0 avatar ionuttulai avatar kirkmunro avatar larisaborodina avatar lingyunsu avatar markcowl avatar microsoftopensource avatar mikhailtryakhov avatar miyanni avatar rakku-ms avatar sarathys avatar shanswmicrosoft avatar sneivandt avatar solankisamir avatar theonlywei avatar travist13 avatar trgrie avatar viananth avatar wecha-ms avatar zyxyoshine avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

azurestack-powershell's Issues

Bad message from Get-AzVmImage

When you enter Get-AzVMImage for an image that doesn't exist, it returns with error "Get-AzVMImage : Object reference not set to an instance of an object."

PS C:\Users\Administrator> Get-AzVMImage -Location local -PublisherName Microsoft -Offer WindowsServer -Skus 2016-Datacenter -debug -verbose
DEBUG: 4:26:59 PM - GetAzureVMImageCommand begin processing with ParameterSet 'ListVMImage'.
DEBUG: 4:27:01 PM - using account id '[email protected]'...
DEBUG: [Common.Authentication]: Authenticating using Account: '[email protected]', environment: 'AzStackAdmin', tenant: '986b5c90-83d4-4fd7-96e7-5e115ad6372c'
DEBUG: [SilentAuthenticator] Creating IPublicClientApplication - ClientId: '1950a258-227b-4e31-a9cf-717495945fc2', Authority: 'https://adfs.local.azurestack.external/adfs/', UseAdf
s: 'True'
DEBUG: [SilentAuthenticator] Calling GetAccountsAsync
DEBUG: [MSAL] Info: (False) MSAL 4.10.0.0 MSAL.CoreCLR N/A [09/17/2020 23:27:01 - 662aacba-ecac-4685-876f-cbbbd662454b] (UnknownClient: 0.0.0.0) [Instance Discovery] Skipping Insta
nce discovery for non-AAD authority
DEBUG: [MSAL] Info: (False) MSAL 4.10.0.0 MSAL.CoreCLR N/A [09/17/2020 23:27:01 - 662aacba-ecac-4685-876f-cbbbd662454b] (UnknownClient: 0.0.0.0) [Instance Discovery] Skipping Insta
nce discovery for non-AAD authority
DEBUG: [SilentAuthenticator] Calling AcquireTokenSilent - Scopes: 'https://adminmanagement.adfs.azurestack.local/986b5c90-83d4-4fd7-96e7-5e115ad6372c/openid', UserId: 'CloudAdmin@a
zurestack.local', Number of accounts: '1'
DEBUG: [MSAL] Info: (False) MSAL 4.10.0.0 MSAL.CoreCLR N/A [09/17/2020 23:27:01 - 4fa93919-896e-47f4-81a7-5c3e648505ce] (UnknownClient: 0.0.0.0) MSAL MSAL.CoreCLR with assembly ver
sion '4.10.0.0'. CorrelationId(4fa93919-896e-47f4-81a7-5c3e648505ce)
DEBUG: [MSAL] Info: (False) MSAL 4.10.0.0 MSAL.CoreCLR N/A [09/17/2020 23:27:01 - 4fa93919-896e-47f4-81a7-5c3e648505ce] (UnknownClient: 0.0.0.0) === OnBehalfOfParameters ===
LoginHint provided: False
User provided: True
ForceRefresh: False

DEBUG: [MSAL] Info: (False) MSAL 4.10.0.0 MSAL.CoreCLR N/A [09/17/2020 23:27:01 - 4fa93919-896e-47f4-81a7-5c3e648505ce] (UnknownClient: 0.0.0.0) 
=== Request Data ===
Authority Provided? - True
Scopes - https://adminmanagement.adfs.azurestack.local/986b5c90-83d4-4fd7-96e7-5e115ad6372c/openid
Extra Query Params Keys (space separated) - 

DEBUG: [MSAL] Info: (False) MSAL 4.10.0.0 MSAL.CoreCLR N/A [09/17/2020 23:27:01 - 4fa93919-896e-47f4-81a7-5c3e648505ce] (UnknownClient: 0.0.0.0) === Token Acquisition (SilentReques
t) started:
	
DEBUG: [MSAL] Info: (False) MSAL 4.10.0.0 MSAL.CoreCLR N/A [09/17/2020 23:27:01 - 4fa93919-896e-47f4-81a7-5c3e648505ce] (UnknownClient: 0.0.0.0) Looking up access token in the cach
e.
DEBUG: [MSAL] Info: (False) MSAL 4.10.0.0 MSAL.CoreCLR N/A [09/17/2020 23:27:01 - 4fa93919-896e-47f4-81a7-5c3e648505ce] (UnknownClient: 0.0.0.0) Filtering by tenant id item count b
efore 1 after 1
DEBUG: [MSAL] Info: (False) MSAL 4.10.0.0 MSAL.CoreCLR N/A [09/17/2020 23:27:01 - 4fa93919-896e-47f4-81a7-5c3e648505ce] (UnknownClient: 0.0.0.0) Filtering by home account id item c
ount before 1 after 1
DEBUG: [MSAL] Info: (False) MSAL 4.10.0.0 MSAL.CoreCLR N/A [09/17/2020 23:27:01 - 4fa93919-896e-47f4-81a7-5c3e648505ce] (UnknownClient: 0.0.0.0) Filtering by token type item count 
before 1 after 1
DEBUG: [MSAL] Info: (False) MSAL 4.10.0.0 MSAL.CoreCLR N/A [09/17/2020 23:27:01 - 4fa93919-896e-47f4-81a7-5c3e648505ce] (UnknownClient: 0.0.0.0) Matching entry count - 1
DEBUG: [MSAL] Info: (False) MSAL 4.10.0.0 MSAL.CoreCLR N/A [09/17/2020 23:27:01 - 4fa93919-896e-47f4-81a7-5c3e648505ce] (UnknownClient: 0.0.0.0) Filtering by scopes item count befo
re 1 after 1
DEBUG: [MSAL] Info: (False) MSAL 4.10.0.0 MSAL.CoreCLR N/A [09/17/2020 23:27:01 - 4fa93919-896e-47f4-81a7-5c3e648505ce] (UnknownClient: 0.0.0.0) [Instance Discovery] Skipping Insta
nce discovery for non-AAD authority
DEBUG: [MSAL] Info: (False) MSAL 4.10.0.0 MSAL.CoreCLR N/A [09/17/2020 23:27:01 - 4fa93919-896e-47f4-81a7-5c3e648505ce] (UnknownClient: 0.0.0.0) [Instance Discovery] Skipping Insta
nce discovery for non-AAD authority
DEBUG: [MSAL] Info: (False) MSAL 4.10.0.0 MSAL.CoreCLR N/A [09/17/2020 23:27:01 - 4fa93919-896e-47f4-81a7-5c3e648505ce] (UnknownClient: 0.0.0.0) Access token is not expired. Return
ing the found cache entry. [Current time (09/17/2020 23:27:01) - Expiration Time (09/18/2020 00:08:20 +00:00) - Extended Expiration Time (01/01/0001 00:00:00 +00:00)]
DEBUG: [MSAL] Info: (False) MSAL 4.10.0.0 MSAL.CoreCLR N/A [09/17/2020 23:27:01 - 4fa93919-896e-47f4-81a7-5c3e648505ce] (UnknownClient: 0.0.0.0) Returning access token found in cac
he. RefreshOn exists ? False
DEBUG: [MSAL] Info: (False) MSAL 4.10.0.0 MSAL.CoreCLR N/A [09/17/2020 23:27:01 - 4fa93919-896e-47f4-81a7-5c3e648505ce] (UnknownClient: 0.0.0.0) === Token Acquisition finished succ
essfully. An access token was returned with Expiration Time: 09/18/2020 00:08:20 +00:00 ===
DEBUG: [Common.Authentication]: Received token with LoginType 'User', Tenant: '986b5c90-83d4-4fd7-96e7-5e115ad6372c', UserId: ''
DEBUG: [Common.Authentication]: Authenticating using Account: '[email protected]', environment: 'AzStackAdmin', tenant: '986b5c90-83d4-4fd7-96e7-5e115ad6372c'
DEBUG: [SilentAuthenticator] Creating IPublicClientApplication - ClientId: '1950a258-227b-4e31-a9cf-717495945fc2', Authority: 'https://adfs.local.azurestack.external/adfs/', UseAdf
s: 'True'
DEBUG: [SilentAuthenticator] Calling GetAccountsAsync
DEBUG: [MSAL] Info: (False) MSAL 4.10.0.0 MSAL.CoreCLR N/A [09/17/2020 23:27:01 - 5f7f1c0a-ab04-417e-9e9c-7af0caf429ba] (UnknownClient: 0.0.0.0) [Instance Discovery] Skipping Insta
nce discovery for non-AAD authority
DEBUG: [MSAL] Info: (False) MSAL 4.10.0.0 MSAL.CoreCLR N/A [09/17/2020 23:27:01 - 5f7f1c0a-ab04-417e-9e9c-7af0caf429ba] (UnknownClient: 0.0.0.0) [Instance Discovery] Skipping Insta
nce discovery for non-AAD authority
DEBUG: [SilentAuthenticator] Calling AcquireTokenSilent - Scopes: 'https://adminmanagement.adfs.azurestack.local/986b5c90-83d4-4fd7-96e7-5e115ad6372c/openid', UserId: 'CloudAdmin@a
zurestack.local', Number of accounts: '1'
DEBUG: [MSAL] Info: (False) MSAL 4.10.0.0 MSAL.CoreCLR N/A [09/17/2020 23:27:01 - f402b1b6-84e1-41ff-bec9-b22fd04a8ac6] (UnknownClient: 0.0.0.0) MSAL MSAL.CoreCLR with assembly ver
sion '4.10.0.0'. CorrelationId(f402b1b6-84e1-41ff-bec9-b22fd04a8ac6)
DEBUG: [MSAL] Info: (False) MSAL 4.10.0.0 MSAL.CoreCLR N/A [09/17/2020 23:27:01 - f402b1b6-84e1-41ff-bec9-b22fd04a8ac6] (UnknownClient: 0.0.0.0) === OnBehalfOfParameters ===
LoginHint provided: False
User provided: True
ForceRefresh: False

DEBUG: [MSAL] Info: (False) MSAL 4.10.0.0 MSAL.CoreCLR N/A [09/17/2020 23:27:01 - f402b1b6-84e1-41ff-bec9-b22fd04a8ac6] (UnknownClient: 0.0.0.0) 
=== Request Data ===
Authority Provided? - True
Scopes - https://adminmanagement.adfs.azurestack.local/986b5c90-83d4-4fd7-96e7-5e115ad6372c/openid
Extra Query Params Keys (space separated) - 

DEBUG: [MSAL] Info: (False) MSAL 4.10.0.0 MSAL.CoreCLR N/A [09/17/2020 23:27:01 - f402b1b6-84e1-41ff-bec9-b22fd04a8ac6] (UnknownClient: 0.0.0.0) === Token Acquisition (SilentReques
t) started:
	
DEBUG: [MSAL] Info: (False) MSAL 4.10.0.0 MSAL.CoreCLR N/A [09/17/2020 23:27:01 - f402b1b6-84e1-41ff-bec9-b22fd04a8ac6] (UnknownClient: 0.0.0.0) Looking up access token in the cach
e.
DEBUG: [MSAL] Info: (False) MSAL 4.10.0.0 MSAL.CoreCLR N/A [09/17/2020 23:27:01 - f402b1b6-84e1-41ff-bec9-b22fd04a8ac6] (UnknownClient: 0.0.0.0) Filtering by tenant id item count b
efore 1 after 1
DEBUG: [MSAL] Info: (False) MSAL 4.10.0.0 MSAL.CoreCLR N/A [09/17/2020 23:27:01 - f402b1b6-84e1-41ff-bec9-b22fd04a8ac6] (UnknownClient: 0.0.0.0) Filtering by home account id item c
ount before 1 after 1
DEBUG: [MSAL] Info: (False) MSAL 4.10.0.0 MSAL.CoreCLR N/A [09/17/2020 23:27:01 - f402b1b6-84e1-41ff-bec9-b22fd04a8ac6] (UnknownClient: 0.0.0.0) Filtering by token type item count 
before 1 after 1
DEBUG: [MSAL] Info: (False) MSAL 4.10.0.0 MSAL.CoreCLR N/A [09/17/2020 23:27:01 - f402b1b6-84e1-41ff-bec9-b22fd04a8ac6] (UnknownClient: 0.0.0.0) Matching entry count - 1
DEBUG: [MSAL] Info: (False) MSAL 4.10.0.0 MSAL.CoreCLR N/A [09/17/2020 23:27:01 - f402b1b6-84e1-41ff-bec9-b22fd04a8ac6] (UnknownClient: 0.0.0.0) Filtering by scopes item count befo
re 1 after 1
DEBUG: [MSAL] Info: (False) MSAL 4.10.0.0 MSAL.CoreCLR N/A [09/17/2020 23:27:01 - f402b1b6-84e1-41ff-bec9-b22fd04a8ac6] (UnknownClient: 0.0.0.0) [Instance Discovery] Skipping Insta
nce discovery for non-AAD authority
DEBUG: [MSAL] Info: (False) MSAL 4.10.0.0 MSAL.CoreCLR N/A [09/17/2020 23:27:01 - f402b1b6-84e1-41ff-bec9-b22fd04a8ac6] (UnknownClient: 0.0.0.0) [Instance Discovery] Skipping Insta
nce discovery for non-AAD authority
DEBUG: [MSAL] Info: (False) MSAL 4.10.0.0 MSAL.CoreCLR N/A [09/17/2020 23:27:01 - f402b1b6-84e1-41ff-bec9-b22fd04a8ac6] (UnknownClient: 0.0.0.0) Access token is not expired. Return
ing the found cache entry. [Current time (09/17/2020 23:27:01) - Expiration Time (09/18/2020 00:08:20 +00:00) - Extended Expiration Time (01/01/0001 00:00:00 +00:00)]
DEBUG: [MSAL] Info: (False) MSAL 4.10.0.0 MSAL.CoreCLR N/A [09/17/2020 23:27:01 - f402b1b6-84e1-41ff-bec9-b22fd04a8ac6] (UnknownClient: 0.0.0.0) Returning access token found in cac
he. RefreshOn exists ? False
DEBUG: [MSAL] Info: (False) MSAL 4.10.0.0 MSAL.CoreCLR N/A [09/17/2020 23:27:01 - f402b1b6-84e1-41ff-bec9-b22fd04a8ac6] (UnknownClient: 0.0.0.0) === Token Acquisition finished succ
essfully. An access token was returned with Expiration Time: 09/18/2020 00:08:20 +00:00 ===
DEBUG: [Common.Authentication]: Received token with LoginType 'User', Tenant: '986b5c90-83d4-4fd7-96e7-5e115ad6372c', UserId: ''
DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
GET

Absolute Uri:
https://adminmanagement.local.azurestack.external/subscriptions/8991992d-03f0-4258-9bf8-fcc4a8c3365f/providers/Microsoft.Compute/locations/local/publishers/Microsoft/artifacttypes/
vmimage/offers/WindowsServer/skus/2016-Datacenter/versions?api-version=2017-12-01

Headers:
x-ms-client-request-id        : aeb29629-b3f5-489a-8167-8c8d9fa96ef2
accept-language               : en-US

Body:



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

Status Code:
NotFound

Headers:
Pragma                        : no-cache
x-ms-correlation-request-id   : fcb1de4c-d8d2-4b5a-8a96-e35d7fd07389
x-ms-ratelimit-remaining-subscription-reads: 14906
x-ms-request-id               : fcb1de4c-d8d2-4b5a-8a96-e35d7fd07389
x-ms-routing-request-id       : LOCAL:20200917T232701Z:fcb1de4c-d8d2-4b5a-8a96-e35d7fd07389
Strict-Transport-Security     : max-age=31536000; includeSubDomains
X-Content-Type-Options        : nosniff
Cache-Control                 : no-cache
Date                          : Thu, 17 Sep 2020 23:27:01 GMT
Server                        : Microsoft-HTTPAPI/2.0
WWW-Authenticate              : oYG3MIG0oAMKAQChCwYJKoZIgvcSAQICooGfBIGcYIGZBgkqhkiG9xIBAgICAG+BiTCBhqADAgEFoQMCAQ+iejB4oAMCARKicQRvfFYwZnIPBGOOfrsYPg0pO2vq1TBll9hPVliIu9yg1mQTJKa4
ucEa/xX6XXX/b04wTbS1XXydp86kukce3tAZdf77TKbR70hQ9NkHx9XmpxYtSmEz8WaxJENsOXy8nQBKRdRtiA6b12qhU9Cz/rXU

Body:



DEBUG: 4:27:01 PM - GetAzureVMImageCommand end processing.
Get-AzVMImage : Object reference not set to an instance of an object.
At line:1 char:1
+ Get-AzVMImage -Location local -PublisherName Microsoft -Offer Windows ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [Get-AzVMImage], NullReferenceException
    + FullyQualifiedErrorId : Microsoft.Azure.Commands.Compute.GetAzureVMImageCommand
 
DEBUG: 4:27:02 PM - GetAzureVMImageCommand end processing.

Get-Azs*Quota throws error when quota doesn't exist

When you run the following command:

Get-AzsStorageQuota -Name "DoesNotExist"

Instead of returning $null, it throws an error. This should is no the expected behavior.

============================ HTTP REQUEST ============================

HTTP Method:
GET

Absolute Uri:
https://management.azure.com/subscriptions/d6446c5c-0c5e-4899-9af0-ee6dde60c397/providers/Microsoft.Storage.Admin/locations/local/quotas/ascanstorquota510?api-version=2019-08-
08-preview

Headers:

Body:



BeforeCall: 
============================ HTTP RESPONSE ============================

Status Code:
NotFound

Headers:
Pragma                        : no-cache
x-ms-correlation-request-id   : bc200d00-b9bc-4d5a-b364-2bfeaeabd70a
x-ms-ratelimit-remaining-subscription-reads: 14955
x-ms-request-id               : bc200d00-b9bc-4d5a-b364-2bfeaeabd70a
x-ms-routing-request-id       : LOCAL:20210517T230009Z:bc200d00-b9bc-4d5a-b364-2bfeaeabd70a
Strict-Transport-Security     : max-age=31536000; includeSubDomains
X-Content-Type-Options        : nosniff
Cache-Control                 : no-cache
Date                          : Mon, 17 May 2021 23:00:09 GMT
Server                        : Microsoft-HTTPAPI/2.0
WWW-Authenticate              : oYG3MIG0oAMKAQChCwYJKoZIgvcSAQICooGfBIGcYIGZBgkqhkiG9xIBAgICAG+BiTCBhqADAgEFoQMCAQ+iejB4oAMCARKicQRvIU8qOXigYqrxMa3MM5fwqeo6Nmx+FR3CZ6yx9SG7IjE
zAPIR+UipPmlpIg+N1lmR/HJ1n7ErdjhHw9NnA7kJabX2HmNJTOFrZM7utsrmSYQMc576wrYHH3cdV86pmGKq2x82GldbR0yLabKp4j9J

Body:
{
  "code": "QuotaNotFound",
  "message": "The specified quota was not found.",
  "target": "ascanstorquota510"
}


ResponseCreated: 
Microsoft.Azure.PowerShell.Cmdlets.StorageAdmin.Runtime.EventData
Microsoft.Azure.PowerShell.Cmdlets.StorageAdmin.Runtime.EventData
Microsoft.Azure.PowerShell.Cmdlets.StorageAdmin.Runtime.EventData
BeforeResponseDispatch: 
Get-AzsStorageQuota_Get : The specified quota was not found.
At C:\az.0.10.0\Azs.Storage.Admin\0.9.0\internal\ProxyCmdletDefinitions.ps1:130 char:23
+         $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: ({ SubscriptionI...nstorquota510 }:<>f__AnonymousType0`3) [Get-AzsStorageQuota_Get], Exception
    + FullyQualifiedErrorId : QuotaNotFound,Microsoft.Azure.PowerShell.Cmdlets.StorageAdmin.Cmdlets.GetAzsStorageQuota_Get
[Finally]: Getting exception 'Microsoft.Azure.Commands.Common.Exceptions.AzPSResourceNotFoundCloudException: InternalException' from response

Azure Bridge Bad Request Errors

We have been getting bad request errors for Invoke-AzsAzureBridgeProductDownload and Remove-AzsAzureBridgeDownloadedProduct. The error looks like the following:

FINALLY Response: 'StatusCode: 400, ReasonPhrase: 'Bad Request', Version: 1.1, Content: System.Net.Http.HttpConnectionResponseContent, Headers:
{
  Server: Microsoft-HTTPAPI/2.0
  Date: Thu, 16 Jul 2020 04:25:53 GMT
  Connection: close
  Content-Type: text/html; charset=us-ascii
  Content-Length: 346
}'
FINALLY Value: '0'
VERBOSE: INFORMATION: FINALLY ExtendedData Type: ''
FINALLY ExtendedData ''
DEBUG: Finally:
Remove-AzsAzureBridgeDownloadedProduct_Delete: The server responded with a Request Error, Status: BadRequest

The issue is caused by appending of request headers from previous requests to the new request until the size of the request header is too large and it becomes a bad request.

Autorest generated cmdlet throwing "Argument passed in is not serializable" error

This is for AzureStack specific admin modules
Some of the generated cmdlets throw "Argument passed in is not serializable" error when incorrect parameter value is passed. In the below examples, "TargetSubscriptionId" parameter value is correct for the first one but not for the second one.

PS C:\Windows\system32> Get-AzsUserSubscription -TargetSubscriptionId "966bbf24-21ce-43bd-8735-e1a4c0eed411"

DelegatedProviderSubscriptionId      DisplayName                  ExternalReferenceId OfferId                                                                           
-------------------------------      -----------                  ------------------- -------                                                                           
209523fa-09a8-4642-93df-58496efe1ca2 EventRPBVTTenantSubscription                     /subscriptions/209523fa-09a8-4642-93df-58496efe1ca2/resourceGroups/EventRPBVTTe...



PS C:\Windows\system32> Get-AzsUserSubscription -TargetSubscriptionId "966bbf24-21ce-43bd-8735-e1a4c0eed418"
Get-AzsUserSubscription : Argument passed in is not serializable.
Parameter name: value
At line:1 char:1
+ Get-AzsUserSubscription -TargetSubscriptionId "966bbf24-21ce-43bd-873 ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Get-AzsUserSubscription_Get], ArgumentException
    + FullyQualifiedErrorId : Microsoft.Azure.PowerShell.Cmdlets.SubscriptionsAdmin.Cmdlets.GetAzsUserSubscription_Get

details here: Azure/autorest.powershell#755

Examples/Synopis missing for few cmdlets

Missing Examples

Azs.Azurebridge.Admin   Invoke-AzsAzureBridgeProductDownload
Azs.Azurebridge.Admin   Remove-AzsAzureBridgeDownloadedProduct
Azs.Subscriptions.Admin Get-AzsSubscriptionsQuota
Azs.Subscriptions.Admin Get-AzsSubscriptionQuota

Missing Synopsis

Module                           Command
------                           -------
Azs.Compute.Admin                Start-AzsDiskMigrationJob
Azs.Compute.Admin                New-AzsComputeQuota
Azs.Compute.Admin                New-AzsDiskMigrationJob
Azs.Compute.Admin                Set-AzsComputeQuota
Azs.Fabric.Admin                 Disable-AzsScaleUnitNode
Azs.Fabric.Admin                 Enable-AzsScaleUnitNode
Azs.Fabric.Admin                 Get-AzsEdgeGateway
Azs.Fabric.Admin                 Get-AzsEdgeGatewayPool
Azs.Fabric.Admin                 Get-AzsInfrastructureRole
Azs.Fabric.Admin                 Get-AzsInfrastructureRoleInstance
Azs.Fabric.Admin                 Get-AzsIPPool
Azs.Fabric.Admin                 Get-AzsLogicalNetwork
Azs.Fabric.Admin                 Get-AzsLogicalSubnet
Azs.Fabric.Admin                 Get-AzsMacAddressPool
Azs.Fabric.Admin                 Get-AzsScaleUnit
Azs.Fabric.Admin                 Get-AzsScaleUnitNode
Azs.Fabric.Admin                 Get-AzsSlbMuxInstance
Azs.Fabric.Admin                 Repair-AzsScaleUnitNode
Azs.Fabric.Admin                 Restart-AzsInfrastructureRole
Azs.Fabric.Admin                 Start-AzsInfrastructureRoleInstance
Azs.Fabric.Admin                 Start-AzsScaleUnitNode
Azs.Fabric.Admin                 Stop-AzsScaleUnitNode
Azs.InfrastructureInsights.Admin Close-AzsAlert
Azs.Network.Admin                New-AzsNetworkQuota
Azs.Network.Admin                Set-AzsNetworkQuota
Azs.Storage.Admin                Get-AzsStorageQuota
Azs.Storage.Admin                New-AzsStorageQuota
Azs.Storage.Admin                Remove-AzsStorageQuota
Azs.Storage.Admin                Restore-AzsStorageAccount
Azs.Storage.Admin                Set-AzsStorageQuota
Azs.Storage.Admin                Set-AzsStorageSettings
Azs.Storage.Admin                Start-AzsReclaimStorageCapacity
Azs.Subscriptions                Remove-AzsSubscription
Azs.Subscriptions.Admin          New-AzsSubscriptionPlan
Azs.Subscriptions.Admin          New-AzsAcquiredPlan
Azs.Subscriptions.Admin          Remove-AzsUserSubscription
Azs.Update.Admin                 Get-AzsUpdate
Azs.Update.Admin                 Get-AzsUpdateRun
Azs.Update.Admin                 Install-AzsUpdate
Azs.Update.Admin                 Resume-AzsUpdateRun

Remove-AzsPlatformImage Does Not Return Anything

For the AzureStack modules that are used with AzureRM, when you run a command like this:

Remove-AzsPlatformImage -Location local -Offer UbuntuServer -Publisher Canonical -Sku 16.04-LTS -Version 1.0.0

Nothing is returned. However it reportedly should return a boolean according to its documentation:

https://docs.microsoft.com/en-us/powershell/module/azs.compute.admin/remove-azsplatformimage?view=azurestackps-2.0.2&viewFallbackFrom=azurestackps-2.5.0

Another issue is that it doesn't seem to remove the image immediately, but this is not documented anywhere. The command does not stall until the removal is complete, so either that feature should be implemented or a warning given to the user.

This issue should be verified with the AzureStack modules that are used with the newer Az modules as well.

Install-AzProfile : Cannot validate argument on parameter 'Profile'.

PS /home/azureuser> Install-AzProfile -Profile 2020-09-01-hybrid -Force
Install-AzProfile: Cannot validate argument on parameter 'Profile'. The argument "2020-09-01-hybrid" does not belong to the set "2019-03-01-hybrid" specified by the ValidateSet attribute. Supply an argument that is in the set and then try the command again.

This issue is happens when AzureRM profile map is already cached in the local machine

$ProfileCache = Join-Path -path $env:ProgramData -ChildPath "Microsoft\AzurePowerShell\ProfileCache"

Start-AzsDiskMigrationJob doesn't validate disks on run

As per process on https://docs.microsoft.com/en-us/azure-stack/operator/azure-stack-manage-storage-shares?view=azs-2108#to-migrate-managed-disks-using-powershell end users are required to create a get-azsdisk object when moving disks. Upon running the disk migration cmdlet seems to take what's in the object at face value up to and including refusing to migrate a disk due to it being "Attached" even though the disk was detached prior to making an object with the appropriate disks to move via get-azsdisk.
Expected behavior should fall in line with other PowerShell cmdlets in validating the data on run rather than assuming the arbitrary data from a cast object is correct in order to prevent issues due to stale data.

AzureStack module fails to load in linux environments

To Repro Simply install AzureStack module in Linux with the instructions from https://aka.ms/az4azurestack and Load the uber module AzureStack

PS /> Import-Module AzureStack -Verbose
VERBOSE: Loading module from path '/root/.local/share/powershell/Modules/AzureStack/2.0.0/AzureStack.psd1'.
Import-Module: The required module 'Azs.AzureBridge.Admin' is not loaded. Load the module or remove the module from 'RequiredModules' in the file '/root/.local/share/powershell/Modules/AzureStack/2.0.0/AzureStack.psd1'.

Root Cause
The published modules Azs.AzureBridge.Admin , Azs.InfrastructureInsights.Admin and Azs.KeyVault are not recognized as modules due to case sensitivity. e.g. the Published module is Azs.Azurebridge.Admin, but ht psd1 file name is Azs.AzureBridge.Admin and the Uber module AzureStack refers to the Module as Azs.AzureBridge.Admin

Support creating user subscription as a Reseller administrator

we need a parameter set in New-AzsSubscription or a new cmdlet for the following REST call

$g = [guid]::NewGuid()
$n = "BalaSubcription3"
$b=@"
{
"id":"",
"subscriptionId":"$g",
"displayName":"$n",
"offerId":"/subscriptions/-5318---/resourceGroups/testRP/providers/Microsoft.Subscriptions/offers/offerd",
"state":"Enabled",
"owner":"[email protected]"
}
"@
$u = "${armendpoint}subscriptions/---903c-8f4c301ee1d0/providers/Microsoft.Subscriptions/subscriptions/${g}?api-version=2018-04-01"
Invoke-RestMethod -Method PUT -Uri $u -Headers @{ Authorization = $C.GetAuthorizationHeader() } -ContentType "application/json" -Body $b

Invalid identity for URI for Remove-AzsAzureBridgeDownloadedProduct

I remember filing a similar issue for this a long time ago, but the issue is still there with his command. Invalid identity for URI for Remove-AzsAzureBridgeDownloadedProduct is caused by the ProductResource object being piped to Remove-AzsAzureBridgeDownloadedProduct:

$azMktplaceVersion | Remove-AzsAzureBridgeDownloadedProduct

Here is the error:

Remove-AzsAzureBridgeDownloadedProduct_DeleteViaIdentity: Invalid identity for URI '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.AzureBridge.Admin/activations/{activationName}/downloadedProducts/{productName}'

I believe this is caused by the fact that productName has "Default/" in the name, when the official name should be what follows "Default/".

[Azs.Compute.Admin] Some pester tests are missing test recordings

These tests are missing recordings

  1. It "TestListInvalidLocation" -Skip:$('TestListInvalidLocation' -in $global:SkippedTests) {
    $global:TestName = 'TestListInvalidLocation'
    $quotas = Get-AzsComputeQuota -Location "thisisnotarealplace"
    $quotas | Should Be $null
    }

  2. It "TestCreatePlatformImage" -Skip:$('TestCreatePlatformImage' -in $global:SkippedTests) {
    
  3. It "TestCreateAndDeletePlatformImage" -Skip:$('TestCreateAndDeletePlatformImage' -in $global:SkippedTests) {
    

AzureStack 1.7.2 module is not catalog signed

Original Post: MicrosoftDocs/azure-docs-powershell#1580

Text:
While customer was installing version 1.7.2, the below error was appearing

The version '0.2.3' of the module 'Azs.Storage.Admin' being installed is not catalog signed. Ensure that the version '0.2.3' of the module 'Azs.Storage.Admin' has the catalog file 'Azs.Storage.Admin.cat' and signed with the same publisher 'CN=Microsoft
Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US' as the previously-installed module 'Azs.Storage.Admin' with version '0.3.1' under the directory 'C:\Program Files\WindowsPowerShell\Modules\Azs.Storage.Admin\0.3.1'. If you still want to install or
update, use -SkipPublisherCheck parameter., update aborted.

Version 1.8.2 was installed, and there is automated script that was installing version 1.7.2, which is not acceptable to be modified by customer to add switch -SkipPublisherCheck, could you help advising why the catalog file is missing , or what is wrong here?

Unexpected response when AzureBridge product doesn't exist

When I run Get-AzsAzureBridgeProduct as below, I get an unexpected response error:

PS C:\tasks\Azure\azurestack-powershell\src\Azs.AzureBridge.Admin\test> get-AzsAzureBridgeProduct -ActivationName "default" -ResourceGroupName "azurestack-activation" -Name "fakeproduct"

Get-AzsAzureBridgeProduct_Get: Unexpected response retrieving product information.

The error should say the resource does not exist, not an "unexpected response".

Az.Boostrap / Install-AzProfile - PowerShellGet - Parameter typo

Typo in module incorrectly refers to PowerShellGet's "AllowPreReleaseVersions" when it instead should be "AllowPreRelease"

When running

Install-AzProfile -Profile 2020-09-01-hybrid -Force

per instructions on Post deployment configurations for ASDK - error message is received:

Install-Package : A parameter cannot be found that matches parameter name 'AllowPrereleaseVersions'.
At C:\Program Files\WindowsPowerShell\Modules\powershellget\2.2.5\PSModule.psm1:9711 char:68
+ ... talledPackages = PackageManagement\Install-Package @PSBoundParameters
+                                                        ~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Install-Package], ParameterBindingException
    + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage

PowerShellGet may need to be updated beyond the default OS installed version 1.0.0.1 (latest is currently 2.2.5) in order to support the 'AllowPreRelease' parameter, if true, this should be taken into account for the Install-AzProfile cmdlet.

[Azs.Compute.Admin] Tests need to properly categorized

The test framework expects each cmdlet have a separate test file. For example,
Set-AzsComputeQuota
should have a test file called "Set-AzsComputeQuota.Tests.ps1" under "test" folder.
If its not provided, the test run will complain saying this test file is missing and the test will be reported as skipped.

Executing script D:\a\1\s\src\Azs.Compute.Admin\test\Set-AzsComputeQuota.Tests.ps1
Running 'playback' mode...
Recording file 'D:\a\1\s\src\Azs.Compute.Admin\test\Set-AzsComputeQuota.Recording.json' is not present. Tests expecting recorded responses will fail

  Describing Set-AzsComputeQuota
    [!] Update, is skipped 0ms

AzureRM.BootStrapper trying to install Az modules

The profile map is cached at the location

For admin: C:\ProgramData\Microsoft\AzurePowerShell\ProfileCache
For user: %localappdata%\Microsoft\AzurePowerShell\ProfileCache

When someone used Az.Bootstrapper on the machine and then go back to AzureRm.BootStrapper , they may run in to this issue
The AzureRm.BootStrapper will use the Az map, try to install Az modules and fail

azurermbootstrapper

Get-AzsNetworkQuota -Name gives 404 error for the Name of the format location\quotaname

Wrong name for Network Quota objects. E.g., when you call Get-AzsNetworkQuota, something like the following is returned:

Id                                                 : /subscriptions/42e35284-3ed7-44d1-9d2e-57fdf2de58fc/providers/Microsoft.Network.Admin/locations/local/quotas/Default 
                                                     Quota
Location                                           : local
MaxLoadBalancersPerSubscription                    : 50
MaxNicsPerSubscription                             : 100
MaxPublicIpsPerSubscription                        : 50
MaxSecurityGroupsPerSubscription                   : 50
MaxVirtualNetworkGatewayConnectionsPerSubscription : 2
MaxVirtualNetworkGatewaysPerSubscription           : 1
MaxVnetsPerSubscription                            : 50
MigrationPhase                                     : None
Name                                               : local/Default Quota
ProvisioningState                                  : Succeeded
Tag                                                : Microsoft.Azure.PowerShell.Cmdlets.NetworkAdmin.Models.Api20150615.ResourceTags
Type                                               : Microsoft.Network.Admin/quotas

Note in particular the "Name" is wrong because it includes "local/", which is not expected. If you try to get the object using that name, it will throw a 404 error because the HTTP request will interpret the slash in "local/" as the beginning of a new path segment. The correct name should be "Default Quota" in this case.

Get-AzStorageUsage is using wrong API version - Get-AzStorageUsage : The resource type 'locations' could not be found in the namespace 'Microsoft.Storage' for api version '2018-11-01'

Get-AzStorageUsage does not work on Azure Stack Hub because it is using 2018-11-01 API.

The supported api-versions are '2017-10-01,2017-06-01,2016-12-01,2016-05-01,2016-01-01,2015-06-15'.

DEBUG: 11:46:02 AM - GetAzureStorageUsageCommand begin processing with ParameterSet '__AllParameterSets'.
DEBUG: 11:46:02 AM - using account id '500a25f0-6350-4a03-8036-b987d81395c4'...
DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
GET

Absolute Uri:
https://management.x.x.x.x/subscriptions/x-x-x-x-x/providers/Microsoft.Storage/locations/x/usages?api-version=2018-11-01

x-ms-client-request-id        : b03ba5e8-83f1-4a92-ae05-x
accept-language               : en-US

Body:


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

Status Code:
NotFound

Headers:
Pragma                        : no-cache
x-ms-failure-cause            : gateway
x-ms-request-id               : 5490307e-d07e-4ffc-9791-x
x-ms-correlation-request-id   : 5490307e-d07e-4ffc-9791-x
x-ms-routing-request-id       : x:20200807T104602Z:5490307e-d07e-4ffc-9791-0efacbf969f4
Strict-Transport-Security     : max-age=31536000; includeSubDomains
X-Content-Type-Options        : nosniff
Cache-Control                 : no-cache
Date                          : Fri, 07 Aug 2020 10:46:02 GMT

Body:
{
  "error": {
    "code": "InvalidResourceType",
    "message": "The resource type 'locations' could not be found in the namespace 'Microsoft.Storage' for api version '2018-11-01'. The supported api-versions are '2017-10-01,2017-06-01,2016-12-01,2016-05-01,2016-01-01,2015-06-15'."
  }
}

Get-AzStorageUsage : The resource type 'locations' could not be found in the namespace 'Microsoft.Storage' for api version '2018-11-01'. The supported api-versions are '2017-10-01,2017-06-01,2016-12-01,2016-05-01,2016-01-01,2015-06-15'.
At line:1 char:1
+ Get-AzStorageUsage -Location "x"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [Get-AzStorageUsage], CloudException
    + FullyQualifiedErrorId : Microsoft.Azure.Commands.Management.Storage.StorageAccount.GetAzureStorageUsageCommand

DEBUG: AzureQoSEvent: CommandName - Get-AzStorageUsage; IsSuccess - False; Duration - 00:00:00.2250584;; Exception - Microsoft.Rest.Azure.CloudException: The resource type 'locations' could not be found in the namespace 'Microsoft.Storage' for api
version '2018-11-01'. The supported api-versions are '2017-10-01,2017-06-01,2016-12-01,2016-05-01,2016-01-01,2015-06-15'.
   at Microsoft.Azure.Management.Storage.UsagesOperations.<ListByLocationWithHttpMessagesAsync>d__5.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 Microsoft.Azure.Management.Storage.UsagesOperationsExtensions.<ListByLocationAsync>d__1.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 Microsoft.Azure.Management.Storage.UsagesOperationsExtensions.ListByLocation(IUsagesOperations operations, String location)
   at Microsoft.Azure.Commands.Management.Storage.StorageAccount.GetAzureStorageUsageCommand.ExecuteCmdlet()
   at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord();
DEBUG: Finish sending metric.
DEBUG: 11:46:03 AM - GetAzureStorageUsageCommand end processing.
PS C:\AzureStackDeployment\modules> Get-Module

ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script     2.0.1      Az.Accounts                         {Add-AzEnvironment, Clear-AzContext, Clear-AzDefault, Connect-AzAccount...}
Script     0.10.0     Az.Compute                          {Add-AzContainerServiceAgentPoolProfile, Add-AzImageDataDisk, Add-AzVhd, Add-AzVMAdditionalUnattendContent...}
Script     0.10.0     Az.Network                          {Add-AzApplicationGatewayAuthenticationCertificate, Add-AzApplicationGatewayBackendAddressPool, Add-AzApplicationGatewayBackendHttpSetting, Add-AzApplicationGatewayFrontendIPConfig...}
Script     1.2.0      Az.Resources                        {Add-AzADGroupMember, Export-AzResourceGroup, Get-AzADAppCredential, Get-AzADApplication...}
Script     1.1.0      Az.Storage                          {Add-AzRmStorageContainerLegalHold, Add-AzStorageAccountManagementPolicyAction, Add-AzStorageAccountNetworkRule, Disable-AzStorageDeleteRetentionPolicy...}

[AzureRM] The version '5.8.3' of the module 'AzureRM.Profile' being installed is not catalog signed.

Trying to install AzureRM.Profile version 5.8.4 and 5.8.3 side by side results in the following error. It can be reproed with the following two liners.

PS C:> Install-Module AzureRM.Profile

PS C:> Install-Module AzureRM.Profile -RequiredVersion 5.8.3
PackageManagement\Install-Package : The version '5.8.3' of the module 'AzureRM.Profile' being installed is not catalog signed. Ensure that the version '5.8.3' of the module
'AzureRM.Profile' has the catalog file 'AzureRM.Profile.cat' and signed with the same publisher 'CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US' as the
previously-installed module 'AzureRM.Profile' with version '5.8.4' under the directory 'C:\Program Files\WindowsPowerShell\Modules\AzureRM.profile\5.8.4'. If you still want to install or
update, use -SkipPublisherCheck parameter.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\2.2.5\PSModule.psm1:9711 char:34

  • ... talledPackages = PackageManagement\Install-Package @PSBoundParameters
  •                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package], Exception
    • FullyQualifiedErrorId : ModuleIsNotCatalogSigned,Validate-ModuleAuthenticodeSignature,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage

Some of our customers are hitting this issue as our AzureRm version 2.5.0 is taking a >= dependency on AzureRm.Profile 5.8.3 and our AzureStack module 1.8.2 is taking = RequiredVersion dependency on 5.8.3.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.