Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate Subscription from generation to main #23255

Merged
merged 2 commits into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 28 additions & 12 deletions src/Subscription/Az.Subscription.format.ps1xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
<TableColumnHeader>
<Label>BillingAccountId</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>OperationId</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>SubscriptionId</Label>
</TableColumnHeader>
Expand All @@ -27,6 +30,9 @@
<TableColumnItem>
<PropertyName>BillingAccountId</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>OperationId</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>SubscriptionId</PropertyName>
</TableColumnItem>
Expand Down Expand Up @@ -150,9 +156,6 @@
<TableColumnHeader>
<Label>BillingOwner</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>DisplayName</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>ProvisioningState</Label>
</TableColumnHeader>
Expand All @@ -172,9 +175,6 @@
<TableColumnItem>
<PropertyName>BillingOwner</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>DisplayName</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>ProvisioningState</PropertyName>
</TableColumnItem>
Expand Down Expand Up @@ -725,9 +725,6 @@
<TableColumnHeader>
<Label>AliasName</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>DisplayName</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>SubscriptionId</Label>
</TableColumnHeader>
Expand All @@ -741,9 +738,6 @@
<TableColumnItem>
<PropertyName>AliasName</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>DisplayName</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>SubscriptionId</PropertyName>
</TableColumnItem>
Expand Down Expand Up @@ -859,6 +853,28 @@
</TableRowEntries>
</TableControl>
</View>
<View>
<Name>Microsoft.Azure.PowerShell.Cmdlets.Subscription.Models.Api20211001.SubscriptionCreationResult</Name>
<ViewSelectedBy>
<TypeName>Microsoft.Azure.PowerShell.Cmdlets.Subscription.Models.Api20211001.SubscriptionCreationResult</TypeName>
</ViewSelectedBy>
<TableControl>
<TableHeaders>
<TableColumnHeader>
<Label>SubscriptionLink</Label>
</TableColumnHeader>
</TableHeaders>
<TableRowEntries>
<TableRowEntry>
<TableColumnItems>
<TableColumnItem>
<PropertyName>SubscriptionLink</PropertyName>
</TableColumnItem>
</TableColumnItems>
</TableRowEntry>
</TableRowEntries>
</TableControl>
</View>
<View>
<Name>Microsoft.Azure.PowerShell.Cmdlets.Subscription.Models.Api20211001.SubscriptionName</Name>
<ViewSelectedBy>
Expand Down
9 changes: 3 additions & 6 deletions src/Subscription/Az.Subscription.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# Generated by: Microsoft Corporation
#
# Generated on: 8/30/2023
# Generated on: 11/6/2023
#

@{
Expand Down Expand Up @@ -73,8 +73,7 @@ FunctionsToExport = 'Disable-AzSubscription', 'Enable-AzSubscription',
'Get-AzSubscriptionAcceptOwnershipStatus',
'Get-AzSubscriptionAlias', 'Get-AzSubscriptionPolicy',
'Invoke-AzSubscriptionAcceptOwnership', 'New-AzSubscriptionAlias',
'Remove-AzSubscriptionAlias', 'Rename-AzSubscription',
'Update-AzSubscriptionPolicy'
'Remove-AzSubscriptionAlias', 'Rename-AzSubscription'

# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
CmdletsToExport = @()
Expand Down Expand Up @@ -112,9 +111,7 @@ PrivateData = @{
# IconUri = ''

# ReleaseNotes of this module
ReleaseNotes = '* Removed the default value for the ''New-AzSubscriptionAlias'' cmdlet parameter ''SubscriptionId''.
* Removed the default value for the ''Get-AzSubscriptionAcceptOwnershipStatus'' cmdlet parameter ''SubscriptionId'' and mark the parameter as mandatory.
* Removed the default value for the ''Invoke-AzSubscriptionAcceptOwnership'' cmdlet parameter ''SubscriptionId'' and mark the parameter as mandatory.'
# ReleaseNotes = ''

# Prerelease string of this module
# Prerelease = ''
Expand Down
10 changes: 10 additions & 0 deletions src/Subscription/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@
- Additional information about change #1
-->
## Upcoming Release
* Invoke-AzSubscriptionAcceptOwnership:
- Added alias `-DisplayName` to parameter `-SubscriptionName`.
* New-AzSubscriptionAlias:
- Added alias `-DisplayName` to parameter `-SubscriptionName`.
* Rename-AzSubscription:
- Changed parameter `-SubscriptionName` to required.
- Added alias `-DisplayName` to parameter `-SubscriptionName`.
* Removed cmdlet `Update-AzSubscriptionPolicy`
* Get-AzSubscriptionAcceptOwnershipStatus
- Updated parameter type of `SubscriptionId` from `string[]` to `string`.

## Version 0.10.1
* Removed the default value for the `New-AzSubscriptionAlias` cmdlet parameter `SubscriptionId`.
Expand Down
46 changes: 44 additions & 2 deletions src/Subscription/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ In this directory, run AutoRest:
> see https://aka.ms/autorest

``` yaml
branch: be90a71f6a482c5b01155b3c9990887529cc6893
branch: 0f39a2d56070d2bc4251494525cb8af88583a938
require:
- $(this-folder)/../readme.azure.noprofile.md
input-file:
Expand Down Expand Up @@ -126,6 +126,16 @@ directive:
variant: ^Get$
remove: true

# operation cmdlet must be removed
- where:
subject: SubscriptionOperation
hide: true
# Service feedback: As only global admins to run this, we don't want to have cmdlets for these as 1st class experience
- where:
verb: Update
subject: SubscriptionPolicy
hide: true

- where:
subject: AcceptSubscriptionOwnership
set:
Expand Down Expand Up @@ -161,6 +171,12 @@ directive:
parameter-name: AdditionalPropertyTag
set:
parameter-name: Tag
# All cmdlets parameter SubscriptionName has the alias DisplayName. ReName-AzSubscription needs to be customized to add an alias.
- where:
parameter-name: DisplayName
set:
parameter-name: SubscriptionName
alias: DisplayName
- where:
subject: Alias
parameter-name: Name
Expand All @@ -173,6 +189,17 @@ directive:
set:
property-name: AliasName

# Need to divided the command into two different ones based on the mutual exclusion parameter:
- where:
verb: New
subject: Alias
hide: true
# SubscriptionName must be required
- where:
verb: Rename
subject: Subscription
hide: true

- from: NewAzSubscriptionAlias_CreateExpanded.cs
where: $
transform: $ = $.replace('[Microsoft.Azure.PowerShell.Cmdlets.Subscription.Runtime.DefaultInfo(', '');
Expand Down Expand Up @@ -222,13 +249,18 @@ directive:
parameter-name: SubscriptionId
required: true

# Updated Parameter type of SubscriptionId from string[] to string.
- where:
verb: Get
subject: AcceptOwnershipStatus
hide: true

- where:
model-name: SubscriptionAliasResponse
set:
format-table:
properties:
- AliasName
- DisplayName
- SubscriptionId
- ProvisioningState
- where:
Expand All @@ -240,4 +272,14 @@ directive:
- PolicyId
- BlockSubscriptionsIntoTenant
- BlockSubscriptionsLeavingTenant
- where:
model-name: AcceptOwnershipStatusResponse
set:
format-table:
properties:
- AcceptOwnershipState
- BillingOwner
- ProvisioningState
- SubscriptionId
- SubscriptionTenantId
```
70 changes: 35 additions & 35 deletions src/Subscription/Subscription.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Accounts", "..\Accounts\Accounts\Accounts.csproj", "{3CF7EAC8-FBCC-4F2C-BE7F-19AA306D43FA}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Accounts", "..\Accounts\Accounts\Accounts.csproj", "{1A685DC2-78F4-4A5D-98A5-104EBD3C625B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AssemblyLoading", "..\Accounts\AssemblyLoading\AssemblyLoading.csproj", "{3E5029BA-AB3D-473B-A73D-14AF26951107}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AssemblyLoading", "..\Accounts\AssemblyLoading\AssemblyLoading.csproj", "{7AF958BA-1FF6-4A67-BB43-3D5ED571EA2D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authentication", "..\Accounts\Authentication\Authentication.csproj", "{4E479E72-AE5C-4657-8A85-5D7EB740D9EE}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authentication", "..\Accounts\Authentication\Authentication.csproj", "{841DD6FE-FDF2-4BCD-A4E2-3A49DA3BD5B2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authentication.ResourceManager", "..\Accounts\Authentication.ResourceManager\Authentication.ResourceManager.csproj", "{2852F1E5-9C0E-4238-BF57-135B3A24E69D}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authentication.ResourceManager", "..\Accounts\Authentication.ResourceManager\Authentication.ResourceManager.csproj", "{FB507F39-A55D-47E6-A64C-9056E197C461}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AuthenticationAssemblyLoadContext", "..\Accounts\AuthenticationAssemblyLoadContext\AuthenticationAssemblyLoadContext.csproj", "{23E6E6DB-A9EA-4007-9521-EC37A0C866B0}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AuthenticationAssemblyLoadContext", "..\Accounts\AuthenticationAssemblyLoadContext\AuthenticationAssemblyLoadContext.csproj", "{F91CF8C2-7A32-4D90-B272-4AAE87CE2922}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authenticators", "..\Accounts\Authenticators\Authenticators.csproj", "{035C5B60-9416-4808-9365-5BDBE37EEBBD}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authenticators", "..\Accounts\Authenticators\Authenticators.csproj", "{2FFA59A3-0F53-4CAC-835B-9BC446ED0BA0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Az.Subscription", "Az.Subscription.csproj", "{980C0C20-CAC8-48D0-9D16-7A0CC0BD2D5F}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Az.Subscription", "Az.Subscription.csproj", "{91971054-DE33-489F-9EC2-C959526352EC}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -26,33 +26,33 @@ Global
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{3CF7EAC8-FBCC-4F2C-BE7F-19AA306D43FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3CF7EAC8-FBCC-4F2C-BE7F-19AA306D43FA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3CF7EAC8-FBCC-4F2C-BE7F-19AA306D43FA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3CF7EAC8-FBCC-4F2C-BE7F-19AA306D43FA}.Release|Any CPU.Build.0 = Release|Any CPU
{3E5029BA-AB3D-473B-A73D-14AF26951107}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3E5029BA-AB3D-473B-A73D-14AF26951107}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3E5029BA-AB3D-473B-A73D-14AF26951107}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3E5029BA-AB3D-473B-A73D-14AF26951107}.Release|Any CPU.Build.0 = Release|Any CPU
{4E479E72-AE5C-4657-8A85-5D7EB740D9EE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4E479E72-AE5C-4657-8A85-5D7EB740D9EE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4E479E72-AE5C-4657-8A85-5D7EB740D9EE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4E479E72-AE5C-4657-8A85-5D7EB740D9EE}.Release|Any CPU.Build.0 = Release|Any CPU
{2852F1E5-9C0E-4238-BF57-135B3A24E69D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2852F1E5-9C0E-4238-BF57-135B3A24E69D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2852F1E5-9C0E-4238-BF57-135B3A24E69D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2852F1E5-9C0E-4238-BF57-135B3A24E69D}.Release|Any CPU.Build.0 = Release|Any CPU
{23E6E6DB-A9EA-4007-9521-EC37A0C866B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{23E6E6DB-A9EA-4007-9521-EC37A0C866B0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{23E6E6DB-A9EA-4007-9521-EC37A0C866B0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{23E6E6DB-A9EA-4007-9521-EC37A0C866B0}.Release|Any CPU.Build.0 = Release|Any CPU
{035C5B60-9416-4808-9365-5BDBE37EEBBD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{035C5B60-9416-4808-9365-5BDBE37EEBBD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{035C5B60-9416-4808-9365-5BDBE37EEBBD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{035C5B60-9416-4808-9365-5BDBE37EEBBD}.Release|Any CPU.Build.0 = Release|Any CPU
{980C0C20-CAC8-48D0-9D16-7A0CC0BD2D5F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{980C0C20-CAC8-48D0-9D16-7A0CC0BD2D5F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{980C0C20-CAC8-48D0-9D16-7A0CC0BD2D5F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{980C0C20-CAC8-48D0-9D16-7A0CC0BD2D5F}.Release|Any CPU.Build.0 = Release|Any CPU
{1A685DC2-78F4-4A5D-98A5-104EBD3C625B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1A685DC2-78F4-4A5D-98A5-104EBD3C625B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1A685DC2-78F4-4A5D-98A5-104EBD3C625B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1A685DC2-78F4-4A5D-98A5-104EBD3C625B}.Release|Any CPU.Build.0 = Release|Any CPU
{7AF958BA-1FF6-4A67-BB43-3D5ED571EA2D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7AF958BA-1FF6-4A67-BB43-3D5ED571EA2D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7AF958BA-1FF6-4A67-BB43-3D5ED571EA2D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7AF958BA-1FF6-4A67-BB43-3D5ED571EA2D}.Release|Any CPU.Build.0 = Release|Any CPU
{841DD6FE-FDF2-4BCD-A4E2-3A49DA3BD5B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{841DD6FE-FDF2-4BCD-A4E2-3A49DA3BD5B2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{841DD6FE-FDF2-4BCD-A4E2-3A49DA3BD5B2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{841DD6FE-FDF2-4BCD-A4E2-3A49DA3BD5B2}.Release|Any CPU.Build.0 = Release|Any CPU
{FB507F39-A55D-47E6-A64C-9056E197C461}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FB507F39-A55D-47E6-A64C-9056E197C461}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FB507F39-A55D-47E6-A64C-9056E197C461}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FB507F39-A55D-47E6-A64C-9056E197C461}.Release|Any CPU.Build.0 = Release|Any CPU
{F91CF8C2-7A32-4D90-B272-4AAE87CE2922}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F91CF8C2-7A32-4D90-B272-4AAE87CE2922}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F91CF8C2-7A32-4D90-B272-4AAE87CE2922}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F91CF8C2-7A32-4D90-B272-4AAE87CE2922}.Release|Any CPU.Build.0 = Release|Any CPU
{2FFA59A3-0F53-4CAC-835B-9BC446ED0BA0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2FFA59A3-0F53-4CAC-835B-9BC446ED0BA0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2FFA59A3-0F53-4CAC-835B-9BC446ED0BA0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2FFA59A3-0F53-4CAC-835B-9BC446ED0BA0}.Release|Any CPU.Build.0 = Release|Any CPU
{91971054-DE33-489F-9EC2-C959526352EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{91971054-DE33-489F-9EC2-C959526352EC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{91971054-DE33-489F-9EC2-C959526352EC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{91971054-DE33-489F-9EC2-C959526352EC}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
37 changes: 0 additions & 37 deletions src/Subscription/UX/Microsoft.Subscription/subscriptions.json

This file was deleted.

9 changes: 8 additions & 1 deletion src/Subscription/build-module.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ if($NoDocs) {
$null = Get-ChildItem -Path $docsFolder -Recurse -Exclude 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue
}
$null = New-Item -ItemType Directory -Force -Path $docsFolder
Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ModuleDescription $moduleDescription -DocsFolder $docsFolder -ExamplesFolder $examplesFolder -ModuleGuid $guid
$addComplexInterfaceInfo = ![System.Convert]::ToBoolean('true')
Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ModuleDescription $moduleDescription -DocsFolder $docsFolder -ExamplesFolder $examplesFolder -ModuleGuid $guid -AddComplexInterfaceInfo:$addComplexInterfaceInfo
}

Write-Host -ForegroundColor Green 'Creating format.ps1xml...'
Expand All @@ -162,4 +163,10 @@ Export-TestStub -ModuleName $moduleName -ExportsFolder $exportsFolder -OutputFol
Write-Host -ForegroundColor Green 'Creating example stubs...'
Export-ExampleStub -ExportsFolder $exportsFolder -OutputFolder $examplesFolder

if (Test-Path (Join-Path $PSScriptRoot 'generate-portal-ux.ps1'))
{
Write-Host -ForegroundColor Green 'Creating ux metadata...'
. (Join-Path $PSScriptRoot 'generate-portal-ux.ps1')
}

Write-Host -ForegroundColor Green '-------------Done-------------'
Loading