Fixed logs href to append -quickstart

Filtered out internal/microsoft hidden-link: tags

Signed-off-by: Graeme Christie <gchristie@bunnings.com.au>

Added changeset

Signed-off-by: Graeme Christie <gchristie@bunnings.com.au>

Fixed filtering tags as object, not array

Signed-off-by: Graeme Christie <gchristie@bunnings.com.au>

Added null coelesce in case azure api returns undefined/null tags response

Signed-off-by: Graeme Christie <gchristie@bunnings.com.au>

Fixed filtering to include all 'hidden-' tags - see https://learn.microsoft.com/en-us/community/content/hidden-tags-azure

Signed-off-by: Graeme Christie <gchristie@bunnings.com.au>

Update .changeset/violet-chicken-smell.md

Co-authored-by: Deepankumar <deepan0433@gmail.com>
Signed-off-by: Graeme Christie <gchristie@bunnings.com.au>

Update violet-chicken-smell.md

Signed-off-by: Graeme Christie <gchristie@bunnings.com.au>

Update .changeset/violet-chicken-smell.md

Co-authored-by: Deepankumar <deepan0433@gmail.com>
Signed-off-by: Graeme Christie <gchristie@bunnings.com.au>
This commit is contained in:
Graeme Christie
2024-02-22 11:24:39 +08:00
parent a9fdfe57de
commit acf3e00e55
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 };