Closed ellismg closed 1 week ago
When I heard that @bradygaster was spending multiple hours blurring out subscription IDs in his videos, I figured something must be done, so here's a cut at a "demo mode" which hides these IDs.
A key problem here is that all the IDs into the portal have a subscription ID in them.
I think we have a few options here:
████████████████████
(i.e. U+2588 FULL BLOCK) to look like we are redacting part of the link. Maybe that's too cute and opens us up to terminal shenanigans, but I figured I'd mention it.Here's the subscription selection list when in "demo mode":
When I heard that @bradygaster was spending multiple hours blurring out subscription IDs in his videos, I figured something must be done, so here's a cut at a "demo mode" which hides these IDs.
A key problem here is that all the IDs into the portal have a subscription ID in them.
I think we have a few options here:
- Do what I've done and just elide these links in our output when "demo mode" is on. The output will look slightly different on customer machines, but it won't look too different.
- We could use a fixed UUID that we just randomly generate once and hardcode in. This would create the appearance of the correct UI but of course if you click on the portal link, it will 404 because of the bogus subscription.
- Something like (2) but instead of using a UUID, use something like
████████████████████
(i.e. U+2588 FULL BLOCK) to look like we are redacting part of the link. Maybe that's too cute and opens us up to terminal shenanigans, but I figured I'd mention it.
What about using the ConsoleLink
component we have for demo-mode?
IIRC we didn't update all links with that component b/c it was not supported by all terminals, but, for demo-mode, it might be ideal. We could even use the same text, swapping the sub id by redacted
but the link would still be clickable,
May elevate using
sudo
on some platforms and configurations
bash:
curl -fsSL https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/3848/uninstall-azd.sh | bash;
curl -fsSL https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/3848/install-azd.sh | bash -s -- --base-url https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/3848 --version '' --verbose --skip-verify
pwsh:
Invoke-RestMethod 'https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/3848/uninstall-azd.ps1' -OutFile uninstall-azd.ps1; ./uninstall-azd.ps1
Invoke-RestMethod 'https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/3848/install-azd.ps1' -OutFile install-azd.ps1; ./install-azd.ps1 -BaseUrl 'https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/3848' -Version '' -SkipVerify -Verbose
PowerShell install
powershell -c "Set-ExecutionPolicy Bypass Process; irm 'https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/3848/uninstall-azd.ps1' > uninstall-azd.ps1; ./uninstall-azd.ps1;"
powershell -c "Set-ExecutionPolicy Bypass Process; irm 'https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/3848/install-azd.ps1' > install-azd.ps1; ./install-azd.ps1 -BaseUrl 'https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/3848' -Version '' -SkipVerify -Verbose;"
MSI install
powershell -c "irm 'https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/3848/azd-windows-amd64.msi' -OutFile azd-windows-amd64.msi; msiexec /i azd-windows-amd64.msi /qn"
And here's what the end to end looks like for deploying the starter aspire app in this mode:
What about using the ConsoleLink component we have for demo-mode? IIRC we didn't update all links with that component b/c it was not supported by all terminals, but, for demo-mode, it might be ideal. We could even use the same text, swapping the sub id by redacted but the link would still be clickable,
I did consider something like this - the reason I didn't pull the trigger is I remember one of the unsupported terminals was the default macOS terminal, and it felt like that was going to be common enough (since that's the default on macs) that it wouldn't end up great in practice.
But I do think that would be a good solution when it is supported everywhere and provides us a nice way to side-step the issue.
OMG!!!!! i can't wait to try it.
When producing content, folks often spend time scrubbing or masking subscription IDs from the output of
azd
. Instead of folks having to spend their time on this, it would be nice ifazd
could do it itself.This change adds support for setting an environment variable,
AZD_DEMO_MODE
, which controls if we will show subscription IDs or not.In cases where we'd previously show a subscription name and ID (like the selection box when we ask a user to pick a subscription, or when a
provision
starts and we print the target subscription and location information) we now just show the name.In cases where we'd show a link to the Portal in messages (e.g. during a deployment when we provide a link into the deployment status) we now just elide the link since the portal links contain the subscription ID as part of the URL.
This saves folks creating content a bunch of time and still keeps the UX very close to what customers actually see (where the subscription ID is useful information to have.)
Fixes #319