Merge pull request #23165 from graemechristie/fix-azure-logs-and-tags

Fixed Azure Portal link and filtered returned tags
This commit is contained in:
Fredrik Adelöw
2024-03-12 13:38:03 +01:00
committed by GitHub
2 changed files with 15 additions and 2 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-azure-sites-backend': minor
---
Azure Sites list now hides the internal/microsoft only `hidden-` tags from the list of tags that are returned. Updated the log endpoint to /logstream-quickstart rather than just /logstream to stream logs in the Azure Portal UI.
@@ -78,9 +78,17 @@ export class AzureSitesApi {
subscriptions: this.config.subscriptions,
});
for (const v of result.data) {
const tags = Object.fromEntries(
Object.entries(v.properties.tags ?? {}).filter(
([k, _]) => !k.startsWith('hidden-'),
),
);
items.push({
href: `${this.baseHref(this.config.domain)}${v.id!}`,
logstreamHref: `${this.baseHref(this.config.domain)}${v.id!}/logStream`,
logstreamHref: `${this.baseHref(
this.config.domain,
)}${v.id!}/logStream-quickstart`,
name: v.name!,
kind: v.kind!,
resourceGroup: v.resourceGroup!,
@@ -90,7 +98,7 @@ export class AzureSitesApi {
usageState: v.properties.usageState!,
state: v.properties.state!,
containerSize: v.properties.containerSize!,
tags: v.properties.tags!,
tags,
});
}
return { items: items };