Solution for Certificate Expiry - Azure Stack

Solution for Certificate Expiry - Azure Stack

  1. Log into Billing RP VM (BillingVM1000).
  2. Replace '<Fill the output path>' in the below script with required path where the certificate will be generated.

$DisplayName = 'BillingCert'

$OutputCertPath = '<Fill the output path>\BillingCert.pfx'

$clientCertificate = New-SelfSignedCertificate -CertStoreLocation "cert:\CurrentUser\My" -Subject "CN=$DisplayName" -KeySpec KeyExchange

$certificateBytes = $clientCertificate.Export([System.Security.Cryptography.X509Certificates.X509ContentType]::pfx)

[System.Convert]::ToBase64String($certificateBytes) | Out-File $OutputCertPath

3. Open the PowerShell ISE as administrator and run the above script to generate new self-signed certificate.
4. Navigate to the location where the certificate got generated and copy it.
5. Install the certificate in both personal and trusted root inside Billing RP VM(BillingVM1000).

6. Export the certificate from BillingVM1000 to upload it in Azure App Registrations.

7. Copy the application ID from below path 'C:\Packages\Plugins\Microsoft.Powershell.DSC\2.77.0.0\DSCWork\setupBillingConfiguration.0\BillingRegistrationOutput.txt']
or from Azure Stack Usage Collector Settings Page of Admin Portal


8. Login to Azure Portal with Service admin credentials (which was used during Billing RP deployment).
9. Navigate to 'App Registrations'.
9.a. Find the application by ID (which is copied in step #7)

10. Drill down into the application and click 'Certificates & Secrets' then click 'Upload certificate'



11. Upload the certificate which is exported in step #6
12. Copy and replace the thump print in Azure Stack Admin portal -> Billing -> Settings -> Azure Stack Usage Collector Details.


13. Execute below command in Command prompt (Admin Mode) to ensure the changes affected the environment. (Required details can be found in Azure Stack Usage Collector Details Page)
BILLING.EXE GetAzureStackUsageData <startTime> <endTime> [/usageRequestType:<String>] [/takeBatchSize:<String>] [/AdminSubscriptionId:<String>] [/TenantDirectoryId:<String>] [/ApplicaionId:<String>] [/CertificateThumbprint:<String>] [/AdminArmEndpoint:<String>] [/TokenRequestResourceUrl:<String>] [/AuthorityEndpointUrl:<String>]