Friday, June 21, 2024

Can't Find Synology NAS in my Network

One day, mapped drives to my NAS stopped working and the NAS itself just disappeared from my network.

My first thought was either the NAS broke or my router. But my router seems fine, so I first checked my NAS by directly connecting to it via ethernet cable to my laptop (using USB converter). I also downloaded the Synology Assistant software which helps a lot in finding whether there's Synology NAS in the network.

The Synology Assistant can be found in Synology Download Center under Desktop Utilities. Synology NAS model required to find the right software.

https://www.synology.com/en-us/support/download


My NAS was working well, so I decided to reboot my router. After the router reboots, I detached the NAS from the laptop and connect it back to the router. And my NAS is discoverable in the network again. However, it happened again when I transferred a large amount of files. Probably it overwhelms the router as I use an old Netgear Wifi 5 router.

There's also a possibility that firewall on the laptop interferes in discovering the NAS, but in my case, since I was able to find it before the issue and no configuration changed since then, it is not a point of concern. But just in case, I did check the firewall configuration as well and it was configured correctly.



Thursday, June 20, 2024

Copying Files with Certain File Extensions using AzCopy Task in Azure DevOps

 I was trying to copy only certain files within a directory to Azure Storage Account instead of the whole directory content.

The files that I tried to copy are those ends with .zip, .tag.gz, and .py. AzCopy support wildcard on the source, so I would like to do something like this:

azcopy copy C:\{directory}\[*.zip|*.tar.gz|*.py] ...

I found out later that there's --include-pattern option, so this works:

azcopy copy C:\{directory}\* --include-pattern *.zip;*.tar.gz;*.py

Azure InvalidTemplate Error: The language expression property array index '1' is out of bounds.

I'm trying to spin up a Redis Cache in Azure and placed it in my Virtual Network. However, it threw an error and the error message was not helping but I eventually figured it out.

Here's my Bicep template which threw an error:

resource cacheSubnet 'Microsoft.Network/virtualNetworks/subnets@2023-11-01' existing = {
name: 'mySubnet'
}

resource redis 'Microsoft.Cache/redis@2023-08-01' = {
name: 'myRedis'
location: resourceGroup().location
properties: {
enableNonSslPort: true
publicNetworkAccess: 'Disabled'
sku: {
capacity: 1
family: 'P'
name: 'Premium'
}
subnetId: cacheSubnet.id
}


Apparently, I needed the parent field on the subnet reference, so I ended with the following template which successfully launched my Redis cache.

resource vNet 'Microsoft.Network/virtualNetworks@2023-11-01' existing = {
name: 'myVNet'
}


resource cacheSubnet 'Microsoft.Network/virtualNetworks/subnets@2023-11-01' existing = {
name: 'mySubnet'
parent: vNet
}

resource redis 'Microsoft.Cache/redis@2023-08-01' = {
name: 'myRedis'
location: resourceGroup().location
properties: {
enableNonSslPort: true
publicNetworkAccess: 'Disabled'
sku: {
capacity: 1
family: 'P'
name: 'Premium'
}
subnetId: cacheSubnet.id
}