问题描述
我正在使用powershell将gallery项添加到我的本地AzureStack(下面的脚本),但是我遇到了错误,因为"resource namespace"microsoft.gallery.admin'无效。 我认为这意味着我的订阅中的microsoft.gallery.admin资源不可用
。
I'm using powershell to add gallery item to my local AzureStack (script below), however I ran into an error for "resource namespace 'microsoft.gallery.admin' is invalid. This I think means that the microsoft.gallery.admin resource is not available in my subscription.
我已进入我的管理员帐户订阅(消费订阅,默认提供商订阅)和计量订阅)并注册了图库的所有内容,但它仍然无效。 所以我的问题是如何启用microsoft.gallery.item
资源。
I've went into my admin accounts subscriptions (Consumption Subscription, Default Provider Subscription, and Metering Subscription) and registered everything for gallery, but it still doesnt work. So my question is how can I enable microsoft.gallery.item resource.
我的第二个问题是与帐户有关Azurestack和Azure。 现在我为Azure云,Azurestack管理员和azurestack用户使用相同的帐户。 ie [email protected]。
My second question is to do with accounts in Azurestack and Azure. Right now I use the same account for my Azure cloud, Azurestack admin, and azurestack user. ie [email protected].
是否有自动生成的azurestacklocal帐户或我可用于管理本地的帐户? 或者此方法是否正常。
Is there an azurestacklocal account that is generated automatically or something that I can use to admin local? Or is this method fine.
提前感谢您的帮助!
Thanks in advance for any help!
$AADTenantName = "azurestoreomitted.onmicrosoft.com"
$ArmEndpoint = "https://management.local.azurestack.external"
# Register an Azure Resource Manager environment that targets your Azure Stack instance
Add-AzureRMEnvironment `
-Name "AzureStackUser" `
-ArmEndpoint $ArmEndpoint
$AuthEndpoint = (Get-AzureRmEnvironment -Name "AzureStackUser").ActiveDirectoryAuthority.TrimEnd('/')
$TenantId = (invoke-restmethod "$($AuthEndpoint)/$($AADTenantName)/.well-known/openid-configuration").issuer.TrimEnd('/').Split('/')[-1]
# Sign in to your environment
Login-AzureRmAccount `
-EnvironmentName "AzureStackUser" `
-TenantId $TenantId
Add-AzsGalleryItem -GalleryItemUri `
https://thomasazsblob.blob.local.azurestack.external/general/omitted.azpkg –Verbose
#$subscriptionid = (Get-AzureRmSubscription -SubscriptionName 'ThomasSubscription').SubscriptionId
#$StorageAccount = Get-AzureRmStorageAccount -ResourceGroupName thomasazslocal -Name thomasazsblob
#$GalleryContainer = New-AzureStorageContainer -Name gallery -Permission Blob -Context $StorageAccount.Context
#$azpkg = $GalleryContainer | Set-AzureStorageBlobContent -File C:\omitted\omitted.azpkg
#Add-AzureRMGalleryItem -SubscriptionId $subscriptionid -GalleryItemUri $azpkg.ICloudBlob.StorageUri.PrimaryUri.AbsoluteUri -Apiversion "2015-04-01"
输出
PS C:\Windows\system32> C:\Users\AzureStackAdmin\Desktop\Untitled1.ps1
Name : AzureStackUser
EnableAdfsAuthentication : False
OnPremise : False
ActiveDirectoryServiceEndpointResourceId : https://management.azurestoreomitted.onmicrosoft.com/##resourceguidomitted##
AdTenant :
GalleryUrl : https://portal.local.azurestack.external:30015/
ManagementPortalUrl :
ServiceManagementUrl :
PublishSettingsFileUrl :
ResourceManagerUrl : https://management.local.azurestack.external
SqlDatabaseDnsSuffix :
StorageEndpointSuffix : local.azurestack.external
ActiveDirectoryAuthority : https://login.windows.net/
GraphUrl : https://graph.windows.net/
GraphEndpointResourceId : https://graph.windows.net/
TrafficManagerDnsSuffix :
AzureKeyVaultDnsSuffix : vault.local.azurestack.external
DataLakeEndpointResourceId :
AzureDataLakeStoreFileSystemEndpointSuffix :
AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix :
AzureKeyVaultServiceEndpointResourceId : https://vault.local.azurestack.external
AzureOperationalInsightsEndpointResourceId :
AzureOperationalInsightsEndpoint :
VersionProfiles : {}
ExtendedProperties : {}
BatchEndpointResourceId :
Environments : {[AzureStackUser, AzureStackUser], [AzureChinaCloud, AzureChinaCloud], [Azure Stack, Azure Stack], [AzureCloud, AzureCloud]...}
Context : Microsoft.Azure.Commands.Profile.Models.PSAzureContext
VERBOSE: Performing the operation "Add Gallery item" on target "https://thomasazsblob.blob.local.azurestack.external/general/omitted.azpkg".
VERBOSE: Performing operation add on $GalleryAdminClient.
VERBOSE: Operation failed.
Get-Exception : Code = InvalidResourceNamespace
Message = The resource namespace 'microsoft.gallery.admin' is invalid.
At C:\Program Files\WindowsPowerShell\Modules\Azs.Gallery.Admin\0.2.0\Get-TaskResult.ps1:99 char:21
+ Get-Exception -Exception $ex
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], Exception
+ FullyQualifiedErrorId : System.Exception,Get-Exception
推荐答案
这篇关于通过上传图库项目进入Azurestack问题,还有一个问题需要澄清帐户类型之间。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!